Forum: Ruby on Rails Problem in number_helper.rb ?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
7157eb3dddcac9e076162fe053c0377d?d=identicon&s=25 esox_ch (Guest)
on 2008-12-06 15:04
(Received via mailing list)
Hello,

Today I noticed that the number_to_currency helper didn't work anymore
(it just returned the numeric value, without any currency).
I tracked down the error and saw that editing line 89
( number_to_currency method) as follows solved the problem :

Old piece of code :

begin
    format.gsub(/%n/, number_with_precision(number,
      :precision => precision,
      :delimiter => delimiter,
      :separator => separator)
      ).gsub(/%u/, unit)
rescue
    number
end

New one :

begin
    format.gsub(/%n/, number_with_precision(number,
      :precision => precision,
      :delimiter => delimiter,
      :separator => separator).to_s
      ).gsub(/%u/, unit)
rescue
    number
end

Is it an issue with Rails ?

Thanks
This topic is locked and can not be replied to.