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

#143 in Value formatting

Download history 3897/week @ 2024-10-01 4004/week @ 2024-10-08 3770/week @ 2024-10-15 4227/week @ 2024-10-22 4462/week @ 2024-10-29 4730/week @ 2024-11-05 4719/week @ 2024-11-12 4843/week @ 2024-11-19 3841/week @ 2024-11-26 3982/week @ 2024-12-03 4561/week @ 2024-12-10 2838/week @ 2024-12-17 1067/week @ 2024-12-24 2587/week @ 2024-12-31 3632/week @ 2025-01-07 3703/week @ 2025-01-14

11,320 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
~23K SLoC