byte_prefix

Crates.iobyte_prefix
lib.rsbyte_prefix
version1.0.0
sourcesrc
created_at2022-07-28 10:58:56.95644
updated_at2022-07-28 10:58:56.95644
descriptionHuman Readable file size formatting
homepagehttps://github.com/charleschege/BytePrefix
repositoryhttps://github.com/charleschege/BytePrefix
max_upload_size
id634355
size32,209
CharlesĀ·Chege (charleschege)

documentation

README

BytePrefix

Rust crates.io

A library to format bytes as specified by The NIST Reference on Constants, Units, and Uncertainty referenced at Prefixes for Binary Multiples

Adding the crate to your crate

$ cargo add byte_prefix

Usage

    // 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);

LICENSE

This crate is licensed under Apache-2.0 or MIT and all contributions will bear the same licenses.

Code of Conduct

All contributions and discussions must adhere to the Rust Code Of Conduct

Commit count: 6

cargo fmt