human_bytes

Function human_bytes 

Source
pub fn human_bytes(n: u64) -> String
Expand description

What: Format a byte count using binary units with one decimal place.

Inputs:

  • n: Raw byte count to format

Output:

  • Size string such as “1.5 KiB” using 1024-based units.

Details:

  • Iteratively divides by 1024 up to PiB, retaining one decimal place for readability.
  • Always shows decimal place (unlike format_bytes which shows integer for bytes < 1024).