On 03 Aug 2009, at 12:20, Franz Strebel wrote: >> There is a way to tell rails to not truncate at the first zero? > > You can use sprintf to always force printing up to 3 decimal places, > eg > > sprintf "%.3f", the_number
Or even better: number_with_precision http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M001687 Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---