Crates.io | byte_prefix |
lib.rs | byte_prefix |
version | 1.0.0 |
source | src |
created_at | 2022-07-28 10:58:56.95644 |
updated_at | 2022-07-28 10:58:56.95644 |
description | Human Readable file size formatting |
homepage | https://github.com/charleschege/BytePrefix |
repository | https://github.com/charleschege/BytePrefix |
max_upload_size | |
id | 634355 |
size | 32,209 |
A library to format bytes as specified by The NIST Reference on Constants, Units, and Uncertainty referenced at Prefixes for Binary Multiples
$ cargo add byte_prefix
// Import the crate
use byte_prefix::calc_bytes;
// The bytes to convert
let size = 1024usize as f32;
// Call `calc_bytes()` function passing the `size` as arguments
let formatted_file_size = calc_bytes(size);
This crate is licensed under Apache-2.0 or MIT and all contributions will bear the same licenses.
All contributions and discussions must adhere to the Rust Code Of Conduct