pub fn format_size(bytes: u64) -> StringExpand description
Format file size in human-readable format.
Converts bytes to the most appropriate unit (B, KB, MB, GB).
§Arguments
bytes- Size in bytes
§Returns
Formatted string (e.g., “1.50 MB”)
§Examples
use fob_cli::ui::format_size;
assert_eq!(format_size(0), "0 B");
assert_eq!(format_size(500), "500 B");
assert_eq!(format_size(1024), "1.00 KB");
assert_eq!(format_size(1_048_576), "1.00 MB");