Printf()
Description
FUNCTION: printf(<format>, <arg1>, …)
Produces formatted output using a format string and arguments, similar to the C printf function.
Supported format specifiers:
- %s - String (ANSI-aware width handling)
- %d - Integer
- %f - Floating-point number
- %c - Single character
- %% - Literal percent sign
Supported modifiers:
- - - Left-justify within field width
- ^ - Center within field width (TinyMUX extension)
- 0 - Zero-pad numeric values
- N - Minimum field width
- .N - Precision (decimal places for floats, max length for strings)
Examples
> say printf(|%-10s|%5d|, Apples, 42)
You say, “|Apples | 42|”
> say printf(%05d, 42)
You say, “00042”
> say printf(|%^10s|, Hello)
You say, “| Hello |”