Formatting specifiers
std.fmt
provides
options for formatting various data types.
std.fmt.fmtSliceHexLower
and std.fmt.fmtSliceHexUpper
provide hex formatting
for strings as well as {x}
and {X}
for ints.
{d}
performs decimal formatting for numeric types.
{c}
formats a byte into an ascii character.
std.fmt.fmtIntSizeDec
and std.fmt.fmtIntSizeBin
output memory sizes in
metric (1000) and power-of-two (1024) based notation.
{b}
and {o}
output integers in binary and octal format.
{*}
performs pointer formatting, printing the address rather than the value.
{e}
outputs floats in scientific notation.
{s}
outputs strings.
This list is non-exhaustive.