4 releases

Uses old Rust 2015

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

#142 in Value formatting

Download history 4350/week @ 2024-08-05 3859/week @ 2024-08-12 4635/week @ 2024-08-19 3852/week @ 2024-08-26 3854/week @ 2024-09-02 3547/week @ 2024-09-09 3273/week @ 2024-09-16 3638/week @ 2024-09-23 3976/week @ 2024-09-30 3831/week @ 2024-10-07 3799/week @ 2024-10-14 3871/week @ 2024-10-21 4344/week @ 2024-10-28 5038/week @ 2024-11-04 4832/week @ 2024-11-11 4927/week @ 2024-11-18

19,344 downloads per month
Used in 40 crates (37 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

~1.2–1.6MB
~22K SLoC