Michael Hasenstein wrote:
> 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

If you read the part of what I wrote that you quoted again, I think 
you'll find that Rails' method does not do the same thing when no 
precision parameter is supplied.
-- 
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to