8.16.0.4
ISO printf
(require iso-printf) | package: iso-printf-lib |
This module provides implementations of the ISO standard C printf family of procedures, based on their description in the OpenBSD manual.
Prints the args to standard output according to the format
string fmt.
The %n directive is not currently supported. The %q directive prints the eq-hash-code of a value in hex format. Directives typically fail gracefully on invalid or missing input, but malformed format strings may raise an error (eg. specifying a precision value twice).
Examples:
> (require iso-printf) > (printf "hello\n") hello
> (printf "%03d\n" 1) 001
> (printf "%04hd %04hd\n" 32767 16777215) 32767 -001
> (printf "%0*.*f\n" 12 3 1234567.89) 01234567.890
> (printf "%+.9g\n" 1234.456789) +1234.45679
Prints the args to standard error according to the format
string fmt.
Constructs a string by interpreting fmt against the given
args.
procedure
out : output-port? fmt : string? arg : any/c
Prints the args to out according to the format
string fmt.