Displaying 1 result from an estimated 1 matches for "file_size_in_words".
2006 May 29
2
Convert bytes to kb or mb in words
Using File.size(myfile) I can get the size of the uploaded file in _bytes_.
Does anybody know of a function to convert bytes into a more human readable
format?
If I had a wish list for a "file_size_in_words()" function, it would do
this:
10752 bytes becomes "10.5 Kilobytes".
2213814 bytes becomes "2.1 Megabytes".
238 bytes becomes "Less Than 1 Kilobyte".
Maybe I need to learn how to write a plug-in and figure it out! Or maybe
somebody has done this and can point me...