pub fn format_size(bytes: u64, human_readable: bool) -> StringExpand description
Format bytes into string with optional human-readable scaling
§Arguments
bytes- The size in bytes to formathuman_readable- If true, formats with appropriate scale (B, KB, MB, GB, TB) If false, returns raw bytes with “bytes” suffix
§Examples
use acme_disk_use::format_size;
assert_eq!(format_size(1024, true), "1.00 KB");
assert_eq!(format_size(1024, false), "1024 bytes");