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

#6 in #convert-bytes

Download history 5325/week @ 2023-12-03 5493/week @ 2023-12-10 3812/week @ 2023-12-17 1676/week @ 2023-12-24 2532/week @ 2023-12-31 3493/week @ 2024-01-07 4096/week @ 2024-01-14 3754/week @ 2024-01-21 4137/week @ 2024-01-28 4181/week @ 2024-02-04 4805/week @ 2024-02-11 4338/week @ 2024-02-18 3871/week @ 2024-02-25 4223/week @ 2024-03-03 5185/week @ 2024-03-10 4403/week @ 2024-03-17

17,895 downloads per month
Used in 34 crates (33 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

~130–360KB