Hi, What is the best way to format amount in RoR? e.g $12000.937 => $12,000.94 Thanks, Hari -- Posted via http://www.ruby-forum.com/.
On Jun 8, 2006, at 5:33 PM, Nara Hari wrote:> Hi, > > What is the best way to format amount in RoR? > > e.g $12000.937 => $12,000.94 > > Thanks, > HariYou 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 Biedenharn http://agileconsultingllc.com Rob@AgileConsultingLLC.com