envzn
0.8 · beta · not released

Library / System / Runtime / FormatSpec

STRUCT

FormatSpec

FormatSpec — parsed $N:<spec> directive carried into Formatter's per-arg renderer. See stdio-spec.md §4.4 for the grammar and per- type semantics. Default-constructed values mean "absent" — align of 0x0 means "type default" (right for numbers, left for everything else); typeLetter of 0x0 means "render via the type's default"; width of 0 means "no minimum width".

Fields 7

boolean present

Has anything been parsed? When FALSE, `Formatter.renderArg` uses its default-rendering path; when TRUE, the spec fields drive the formatted output.

char32 fill

Single fill char. ASCII space (0x20) by default.

char32 align

Alignment marker: '<' / '>' / '^', or 0x0 for "type default".

char32 sign

Sign marker: '+' (force on positives) / '-' (default — only on negatives), or 0x0 (treated as '-').

uint32 width

Minimum render width in code points. 0 means "no minimum".

char32 typeLetter

Type letter: 'd' / 'x' / 'X' / 'o' / 'b' / 's', or 0x0 for "no type override (use the arg's default render)".

char32 groupSep

Group size is fixed by the TYPE, not the spec: 3 for decimal, 4 for the radix letters x/X/o/b — nibble-aligned, so a grouped hex value reads by byte pairs. The separator is counted WITHIN the field, so it sits inside zero-padding.