Function format_size

Source
pub fn format_size(bytes: u64) -> String
Expand description

Formats a size in bytes in a readable way.

Decimal units, 1 kB being 1000 bytes: that is what macOS Finder and most Linux file managers show, so the figure matches what the system says about the same files. Dividing by 1024 while writing “MB” — the usual shortcut — understates an album by about 5%, which is exactly the kind of discrepancy a user reports as a bug.