Crates.io | simplebyteunit |
lib.rs | simplebyteunit |
version | 0.2.1 |
source | src |
created_at | 2023-09-27 05:38:20.231988 |
updated_at | 2023-10-01 01:57:44.332245 |
description | A thin encapsulate for integer primitives to facilitate a fast, simple, yet ergonomic byteunit implementation. |
homepage | |
repository | https://github.com/sapphirusberyl/simplebyteunit |
max_upload_size | |
id | 984297 |
size | 21,271 |
SimpleByteUnit is a crate which provides a thin encapsulate for integer primitives to facilitate a fast, simple, yet ergonomic byteunit implementation.
Add 'simplebyteunit' to your 'Cargo.toml':
[dependencies]
simplebyteunit = "0.2.0"
Generate a human-readable, formatted ByteUnit:
use simplebyteunit::simplebyteunit::*;
let byteunit_var = 500000.to_byteunit(SI);
println!("{byteunit_var}");
Output:
500 kB