Crates.io | sizes |
lib.rs | sizes |
version | 0.1.3 |
source | src |
created_at | 2023-10-27 20:39:41.809007 |
updated_at | 2023-10-27 20:48:43.07777 |
description | A crate to format byte sizes |
homepage | https://crates.io/crates/sizes |
repository | https://gitlab.com/xdevs23/crate-sizes |
max_upload_size | |
id | 1016443 |
size | 5,700 |
A crate to format byte sizes.
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