number_with_precision return Integer

为君一笑 提交于 2020-01-06 07:44:53

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!