Function format_size

Source
pub fn format_size(size: Option<u64>) -> String
Expand description

Format size in human readable form, and shows the small changes.

For files larger than 1MB, it shows the last 3 digits, so that small changes are visible.

MB, GB, TB are used for sizes larger than 1MB, 1GB, 1TB respectively Calculations for these are done with 1024 as base, not 1000.

Returns a string of spaces with the same size of column if size is None.