Formatting amount

Hi,

What is the best way to format amount in RoR?

e.g $12000.937 => $12,000.94

Thanks,
Hari

On Jun 8, 2006, at 5:33 PM, Nara H. wrote:

Hi,

What is the best way to format amount in RoR?

e.g $12000.937 => $12,000.94

Thanks,
Hari

You can grab the code from: http://wiki.rubygarden.org/Ruby/page/
show/NumericFormat
and put it into your lib directory and add a require to your
environment.rb.

or just look at http://api.rubyonrails.org/classes/ActionView/Helpers/
NumberHelper.html#M000449

-Rob

Rob B. http://agileconsultingllc.com
[email protected]