format, SRFI-48. MIT Scheme, #! Racket ().
(import (rnrs base)
(srfi :48))
(format "~4F " "x") ; ==> " x"
SRFI-48 #! :
(require srfi/48)
(format "~4F " "x") ; ==> " x"
F :
~ [w [, d]] F Fixed ~ w, dF displays a number with a width of w and d digits after the decimal point; ~ wF prints a string or number with a width of w.
Also, when evaluating (format "~h"), you get instructions for use, so you don’t need to visit the SRFI page for a basic syntax reminder.
source
share