#human-readable #size #format #heap-allocation #no-alloc #no-std

no-std size_fmt

This library formats sizes in a human readable format

2 releases

0.1.1 Jul 7, 2024
0.1.0 Jun 23, 2024

#133 in Value formatting


Used in nls-ls

MIT/Apache

29KB
780 lines

size_fmt

CICD Crates.io Docs.rs License

This library formats sizes in a human readable format.


The API and Implementation is inspired by dtolnay/itoa.


Features

Example

fn main() {
    let mut buffer = size_fmt::Buffer::new();
    let printed = buffer.human_fmt(4096);

    assert_eq!(printed, "4.0K")
}

Dependencies

~400KB