#byte-size #format #mib #binary-size #yib

sizes

A crate to format byte sizes

4 releases

0.1.3 Oct 27, 2023
0.1.2 Oct 27, 2023
0.1.1 Oct 27, 2023
0.1.0 Oct 27, 2023

#2 in #mib

MIT OR BSD-3-Clause OR LGPL-3.0-only

6KB
86 lines

sizes

A crate to format byte sizes.

Example

use sizes::{BinarySize};
println!("{}", BinarySize::from(2_u64*1024*1024).rounded());
// Result: 2.00 MiB
use sizes:{BinarySize, YIB};
println!("{}", BinarySize::from(2_u128*YIB));
// Result: 2 YiB

No runtime deps