Expand description
Formatting utilities for bytes, percentages, durations, and numbers.
Consolidates byte-formatting implementations previously duplicated across pmat, trueno-viz, aprender, and trueno.
Functionsยง
- format_
bytes - Format bytes in human-readable form (IEC-style with short units).
- format_
bytes_ compact - Format bytes compactly with short IEC-based units and no spaces.
- format_
bytes_ full - Format bytes with variable precision and full unit labels.
- format_
bytes_ iec - Format bytes using IEC units (powers of 1024).
- format_
bytes_ rate - Format bytes per second as a rate string.
- format_
bytes_ si - Format bytes using SI units (powers of 1000).
- format_
duration - Format a duration in seconds to human-readable form.
- format_
duration_ compact - Format a duration compactly (always fixed-width, 6 chars).
- format_
freq_ mhz - Format frequency in MHz to human-readable GHz/MHz.
- format_
number - Format a number with thousands separators.
- format_
percent - Format a percentage value (0.0 to 100.0) with 1 decimal place.
- format_
percent_ clamped - Format a percentage clamped to 0-100 range.
- format_
percent_ fixed - Format a percentage with fixed decimal places.
- usage_
percent - Compute and format a percentage from a fraction.