问题
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.
来源:https://stackoverflow.com/questions/10842529/number-with-precision-return-integer