What is the most elegant way in javascript to convert bytes into a readable format
<p>I found a very elegant 'humanize' converter for Java on stackoverflow which didn't use any loops.</p>

<p>Is it possible to do the same with javascript?  (e.g 1024 bytes => 1 kb)?</p>

<p>As simple as it sounds I have done quite a search for it</p>

<p>Incase you're wondering : <a href="http://stackoverflow.com/questions/3758606/how-to-convert-byte-size-into-human-readable-format-in-java">Java Version</a></p>
