# Problem in number\_helper.rb?

**URL:** <https://www.ruby-forum.com/t/problem-in-number-helper-rb/155027>\
**Category:** Rails\
**Created:** [December 6, 2008, 3:04pm UTC](https://www.ruby-forum.com/t/problem-in-number-helper-rb/155027 "2008-12-06T15:04:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![esox\_ch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/4da419/32.png) [@esox\_ch](https://www.ruby-forum.com/u/esox_ch)\
**Post date:** [December 6, 2008, 3:04pm UTC](https://www.ruby-forum.com/t/problem-in-number-helper-rb/155027/1 "2008-12-06T15:04:55Z")

</div>

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
