# Format number as currency in controller

**URL:** <https://www.ruby-forum.com/t/format-number-as-currency-in-controller/162961>\
**Category:** Ruby\
**Created:** [March 16, 2009, 9:57am UTC](https://www.ruby-forum.com/t/format-number-as-currency-in-controller/162961 "2009-03-16T09:57:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike343](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike343](https://www.ruby-forum.com/u/mike343)\
**Post date:** [March 16, 2009, 9:57am UTC](https://www.ruby-forum.com/t/format-number-as-currency-in-controller/162961/1 "2009-03-16T09:57:10Z")

</div>

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:

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

any pointers to the right direction would be most welcome

Michael
