Function re_format::format_bytes
source · pub fn format_bytes(number_of_bytes: f64) -> String
Expand description
Pretty format a number of bytes by using SI notation (base2), e.g.
assert_eq!(format_bytes(123.0), "123 B");
assert_eq!(format_bytes(12_345.0), "12.1 KiB");
assert_eq!(format_bytes(1_234_567.0), "1.2 MiB");
assert_eq!(format_bytes(123_456_789.0), "118 MiB");