chickadee » fmt » num

(num <n> [<radix> <precision> <sign> <comma> <comma-sep> <decimal-sep>])procedure

Formats a single number <n>. You can optionally specify any <radix> from 2 to 36 (even if <n> isn't an integer). <precision> forces a fixed-point format.

A <sign> of #t indicates to output a plus sign (+) for positive integers. However, if <sign> is a character, it means to wrap the number with that character and its mirror opposite if the number is negative. For example, #\( prints negative numbers in parenthesis, financial style: -3.14 => (3.14).

<comma> is an integer specifying the number of digits between commas. Variable length, as in subcontinental-style, is not yet supported.

<comma-sep> is the character to use for commas, defaulting to #\,.

<decimal-sep> is the character to use for decimals, defaulting to #\., or to #\, (European style) if <comma-sep> is already #\..

These parameters may seem unwieldy, but they can also take their defaults from state variables, described below.