Expand description
Formatting and parsing human-readable data sizes.
Functionsยง
- format_
bytes - Formats a raw byte count into a human-readable string (e.g.
1048576->"1.00 MB"). Supported units: B, KB, MB, GB, TB, PB. - parse_
bytes - Parses human-readable sizes (e.g.
"5MB","10KB","2GB") into a raw byte count (u64). Case-insensitive, supports optional space, and treats unit-less values as bytes.