Skip to main content

Module str_utils

Module str_utils 

Source
Expand description

String formatting helpers: byte counts, plurals, path conversion.

Functionsยง

format_bytes
Format a byte count as a human-readable string with one decimal place. Examples: "0 B", "512 B", "1.0 KB", "3.5 MB", "1.2 GB".
path_to_string
Convert a Path to a String via display().
plural
Returns "" when n == 1, otherwise "s".