Maybe following will be better number_to_human_size(File.size(abc.csv), unit: :mb)
On Friday, May 15, 2015 at 12:21:13 PM UTC+9, Mahesh Baheti wrote: > > As I understand currently number_to_human_size helper supports bytes to > nearest unit conversion. While using this helper I felt the need of an > option 'unit' to specify the unit to return the conversion into. > > For example, > > number_to_human_size(File.size(abc.csv), unit: "MB") > > This is feasible without much effort. In our application we have monkey > patched it, as we need it a lot. I think this might be what a lot of > developers need. > > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-core+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-core@googlegroups.com. Visit this group at http://groups.google.com/group/rubyonrails-core. For more options, visit https://groups.google.com/d/optout.