byte_prefix 1.0.0

Human Readable file size formatting
Documentation
  • Coverage
  • 100%
    16 out of 16 items documented1 out of 1 items with examples
  • Size
  • Source code size: 31.85 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.58 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Homepage
  • charleschege/BytePrefix
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • charleschege

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