Expand description
Human-readable sizes and ages, and parsers for their command-line forms.
Enums§
- Units
- How sizes are displayed.
Functions§
- format_
age - Format an age in its largest whole unit,
45 minutes,3 days,11 months, or in years to one decimal,1 year,2.5 years. Months and years have the lengthsparse_agegives them, so a parsed1yformats as1 year. - format_
count - Format a count with thousands separators:
300,020. - format_
size - Format a byte count with three significant digits:
999 B,1.50 kB,52.3 GB,140 GB. - parse_
age - Parse
90min,12h,30d,2w,6mo,1y. A baremis rejected as ambiguous between minutes and months. - parse_
size - Parse
500,100MB,1.5 GiB,2g. Decimal units are powers of 1000,*iBunits powers of 1024. Integer amounts are exact.