# Locale currency only works for displaying numbers?

**URL:** <https://www.ruby-forum.com/t/locale-currency-only-works-for-displaying-numbers/196926>\
**Category:** Rails\
**Created:** [April 1, 2009, 8:51am UTC](https://www.ruby-forum.com/t/locale-currency-only-works-for-displaying-numbers/196926 "2009-04-01T08:51:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![raimon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@raimon](https://www.ruby-forum.com/u/raimon)\
**Post date:** [April 1, 2009, 8:51am UTC](https://www.ruby-forum.com/t/locale-currency-only-works-for-displaying-numbers/196926/1 "2009-04-01T08:51:44Z")

</div>

Hello,

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  
…

thanks!

r.

---

<div class="post-metadata">

**Author:** ![raimon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@raimon](https://www.ruby-forum.com/u/raimon)\
**Post date:** [September 3, 2009, 5:35pm UTC](https://www.ruby-forum.com/t/locale-currency-only-works-for-displaying-numbers/196926/2 "2009-09-03T17:35:28Z")

</div>

I have the same problem, do you have the solution?  
thanks
