Skip to main content

format_size

Function format_size 

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

Renders a byte count the way a human reads it.

Exact multiples get a bare suffix (256 MiB); anything else keeps one decimal (1.5 GiB), because rounding a limit or a declared size to a tidy figure would be actively unhelpful in a message someone is using to size a flag.