0

I have a very weird problem with number_with_precision() and number_to_currency().

In my application, they both raise an comparison of String with 0 failed if i do not set :precision

But when i try the very same functions in irb, everything is fine :

1.9.3p0 :058 > helper.number_with_precision(12)
 => "12.000" 
1.9.3p0 :059 > helper.number_to_currency(12)
 => "12.00 €" 

I looked in to my Gemfile, guessing it could be coming from one of my Gem, but i did not find anything.

I have the strange sensation that something is overriding number_with_delimiter(), causing this error, but i can't find out what.

FYI, i use Rails 3.2.1 and ruby 1.9.1, and here is my Gemfile: https://gist.github.com/2847099

Thank you per advance.

AkyRhO
  • 187
  • 2
  • 11
  • 1
    Do you have any [localized defaults](https://github.com/rails/rails/blob/c70135807ed786e6c9e18a35cc83ac6007450ca2/actionpack/lib/action_view/helpers/number_helper.rb#L299) that would be different in your app and `irb`? – mu is too short Jun 01 '12 at 00:11
  • Thank you! I found out there was a typo in my locales and everything went OK! – AkyRhO Jun 02 '12 at 08:41

0 Answers0