Gavin Kistner wrote: > While ActionView in rails does have a helper for this, it requires you > to supply the number of decimal places. What follows is my own code (as > a Ramaze helper) that (by default) automatically determines the number > of decimal places based on the size of the answer.
I just found this thread an Rails' number_to_human_size does exactly what you want as far as I can see, so there is no need to write your own function it seems? http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M001656 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---