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

#116 in Value formatting

Download history 4863/week @ 2024-06-02 4588/week @ 2024-06-09 4802/week @ 2024-06-16 4377/week @ 2024-06-23 4214/week @ 2024-06-30 4793/week @ 2024-07-07 4827/week @ 2024-07-14 4101/week @ 2024-07-21 3743/week @ 2024-07-28 4376/week @ 2024-08-04 3849/week @ 2024-08-11 4666/week @ 2024-08-18 3867/week @ 2024-08-25 3880/week @ 2024-09-01 3469/week @ 2024-09-08 3373/week @ 2024-09-15

14,898 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.1–1.6MB
~22K SLoC