Forum: Ruby Format number as currency in controller

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and 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:

mystring = "Your budget is " + number_to_currency(budget.value)

any pointers to the right direction would be most welcome

This topic is locked and can not be replied to.