#size #format #human-readable #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

#126 in Value formatting

Download history 159/week @ 2024-06-21 10/week @ 2024-06-28 123/week @ 2024-07-05 9/week @ 2024-07-12 4/week @ 2024-07-19 19/week @ 2024-07-26

85 downloads per month

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

~415KB