Convert bytes to a human readable string: 1337 → 1.34 kB
Useful for displaying file sizes for humans, Ported from sindresorhus/pretty-bytes
$ pretty-bytes 1337
1.34 kB
$ echo 1337 | pretty-bytes
1.34 kB
extern crate pretty_bytes;
use pretty_bytes::converter::convert;
println!("{}", convert(1337_f64));
MIT