[plt-scheme] C-style Printf Format Convention?
(format "This string is formatted. Newline: ~n; display: ~a; write: ~s;
print: ~v; binary: ~b; octal: ~o; hexadecimal: ~x; tilde: ~~; search the
held desk for \"format\" for more details." "thing to display" "thing to
write" "thing to print" 100 100 100)
-->
This string is formatted. Newline:
; display: thing to display; write: "thing to write"; print: "thing to
print"; binary: 1100100; octal: 144; hexadecimal: 64; tilde: ~; search the
held desk for "format" for more details.
> -----Original Message-----
> From: plt-scheme-admin at list.cs.brown.edu [mailto:plt-scheme-
> admin at list.cs.brown.edu] On Behalf Of Brent Fulgham
> Sent: Wednesday, May 12, 2004 12:05 AM
> To: PLT Scheme
> Subject: [plt-scheme] C-style Printf Format Convention?
>
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
> Is there a PLT string format function that works like
> the C printf?
>
> My goal is to be able to print a number with an
> arbitrary
> number of digits, regardless of its actual magnitude:
>
> e.g.,:
>
> printf("%-10.5d", 1.23);
>
> => 1.2300
>
> Is there a formatting utility I can use for this?
>
> Thanks,
>
> -Brent