Forum: Ruby Format number as currency in controller

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.
Michael M. (Guest)
on 2009-03-16 10:57
I am trying to prepare a string in a controller and that to format a
number as a currency in that string.

I can't use number_to_currency as that only works in the view (as far as
I can see)

The kind of thing I want to do is:

[code]
mystring = "Your budget is " + number_to_currency(budget.value)
[/code]

any pointers to the right direction would be most welcome

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