4 releases

0.2.2 Oct 2, 2017
0.2.1 Dec 15, 2016
0.2.0 Dec 14, 2016
0.1.0 Oct 27, 2015

#77 in Value formatting

Download history 219/week @ 2019-12-02 279/week @ 2019-12-09 215/week @ 2019-12-16 116/week @ 2019-12-23 173/week @ 2019-12-30 346/week @ 2020-01-06 315/week @ 2020-01-13 171/week @ 2020-01-20 204/week @ 2020-01-27 469/week @ 2020-02-03 210/week @ 2020-02-10 146/week @ 2020-02-17 228/week @ 2020-02-24 385/week @ 2020-03-02 1081/week @ 2020-03-09 243/week @ 2020-03-16

2,054 downloads per month
Used in 15 crates (14 directly)

MIT license

4KB
67 lines

rust-pretty-bytes Circle CI

Convert bytes to a human readable string: 1337 → 1.34 kB

Useful for displaying file sizes for humans, Ported from sindresorhus/pretty-bytes

Usage

CLI

$ pretty-bytes 1337
1.34 kB

$ echo 1337 | pretty-bytes
1.34 kB

API

extern crate pretty_bytes;
use pretty_bytes::converter::convert;

println!("{}", convert(1337_f64));

License

MIT

Dependencies

~140KB