Forum: Ruby on Rails locale currency only works for displaying numbers ??

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
D48be99143e13e40d1c44a4da63a53f4?d=identicon&s=25 Mongeta 99 (raimon)
on 2009-04-01 08:51

Using a locale I can format the same number for displaying it:

database: 1900.58
en layout: 1,900.58
cat layout: 1.900,58

this is ok ....

but how I can do the reverse of it, when the user submits via form a
number in it's locale format ?

for example if the user enters in cat locale: 1900,58 the resulted
number is 1900.00

currently I'm evaluating every field number and replacing commas by
dots, but it's a pain to format/adjust everyplace there is a number
coming from a form.

I thought Rails I18n should handle this in a transparent manner ... or
sure I'm missing the point here and maybe there's a function to do it


905f57501bf2a8b613f2c4648122a5af?d=identicon&s=25 Penelope West (penelope)
on 2009-09-03 17:35
I have the same problem, do you have the solution?
This topic is locked and can not be replied to.