I have a field on javascript for format values currency. The format is "123,456.50", but when I save, is saved "123.0". I want before save, format the value "123,456.50" for "123456.50". Our another soluction is comming well. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Marcelo Junior wrote:> I have a field on javascript for format values currency. The format is > "123,456.50", but when I save, is saved "123.0". I want before save, > format the value "123,456.50" for "123456.50". Our another soluction is > comming well.Why do you use JS? use NumberHelper method number_to_currency in the Views. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Elad Meidar wrote:> Marcelo Junior wrote: >> I have a field on javascript for format values currency. The format is >> "123,456.50", but when I save, is saved "123.0". I want before save, >> format the value "123,456.50" for "123456.50". Our another soluction is >> comming well. > > Why do you use JS? use NumberHelper method number_to_currency in the > Views.I would like that when the user insert de value, the values to be on format. That the user does not need to type "," for decimals, and that the value already is formatted while be typing the value. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---