/// Human-readable byte size with one decimal: `"1.2 MB"`, `"312.5 KB"`,
/// `"512 B"`. Threshold is binary (1 KB = 1024 bytes).
pub fn format_size(size: u64) -> String {
const KB: u64 = 1024;
const MB: u64 = 1024 * KB;
const GB: u64 = 1024 * MB;
if size >= GB {
format!("{:.1} GB", size as f64 / GB as f64)
} else if size >= MB {
format!("{:.1} MB", size as f64 / MB as f64)
} else if size >= KB {
format!("{:.1} KB", size as f64 / KB as f64)
} else {
format!("{size} B")
}
}