#pretty #byte #display #format

repr-size

Ergonomic functions to display a count of bytes to an end user

3 releases

0.1.2 May 19, 2022
0.1.1 May 18, 2022
0.1.0 May 18, 2022

#62 in #pretty

Download history 8/week @ 2024-07-21 6/week @ 2024-07-28 25/week @ 2024-08-04 26/week @ 2024-08-11 65/week @ 2024-08-18 72/week @ 2024-08-25 102/week @ 2024-09-01 117/week @ 2024-09-08 66/week @ 2024-09-15 157/week @ 2024-09-22 128/week @ 2024-09-29 162/week @ 2024-10-06 72/week @ 2024-10-13 16/week @ 2024-10-20 1/week @ 2024-10-27

122 downloads per month

MIT/Apache

9KB
118 lines

repr-bytes

Small, simple library to convert byte amounts to pretty, human readable sizes.

Quickstart

let my_file_size = Size::from(54222);

println!("{}", my_file_size); // "54.2 KB"
println!("{}", my_file_size.to_si_string()); // "53.0 KiB"
println!("{}", my_file_size.repr(Units::Bytes)); // "54222 B"

Features

serde - enables serialization/deserialization of Size <-> usize


lib.rs:

Small, simple library to convert byte amounts to pretty, human readable sizes.

Quickstart

let my_file_size = Size::from(54222);

println!("{}", my_file_size); // "54.2 kB"
println!("{}", my_file_size.to_si_string()); // "53.0 KiB"
println!("{}", my_file_size.repr(Units::Bytes)); // "54222 B"

Features

serde - enables serialization/deserialization of Size <-> usize

Dependencies

~160KB