module

Dust::SizeFormat

Size and min-size formatting, ported from display.rs and config.rs.

Constants

IEC_UNITS = ["Pi", "Ti", "Gi", "Mi", "Ki"] of ::String
SI_UNITS = ["P", "T", "G", "M", "K"] of ::String

Instance methods

base(format : String) : UInt64

Are we working in powers of 1000 or 1024?

Source
humanize(size : UInt64, format : String) : String
Source
number_format(format : String) : Tuple(UInt64, String) | Nil

A forced output unit (-o kib, -o b, ...) as {multiplier, suffix}.

Source
parse_min(input : String) : UInt64 | Nil

Parses --min-size. Accepts bare bytes and any SI/IEC suffix, case insensitively. Returns nil (after warning) for anything else.

Source
units(format : String) : Array(String)
Source