Forum: Ruby on Rails formatting amount

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.
Nara H. (Guest)
on 2006-06-09 01:33
Hi,

What is the best way to format amount in RoR?

e.g $12000.937 => $12,000.94

Thanks,
Hari
Rob B. (Guest)
on 2006-06-15 21:22
(Received via mailing list)
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
removed_email_address@domain.invalid
This topic is locked and can not be replied to.