## Function: COMMON-LISP:FORMAT [![package](https://img.shields.io/badge/Package-COMMON--LISP-5f9ea0.svg?style=social&colorA=999999)](../) [![type](https://img.shields.io/badge/Type-Function-5f9ea0.svg?style=social&colorA=999999)](../#function) [![clhs](https://img.shields.io/badge/CLHS-FORMAT-5f9ea0.svg?style=social&colorA=999999)](http://www.lispworks.com/documentation/HyperSpec/Body/f_format.htm) [![github](https://img.shields.io/badge/GitHub-View_the_source-5f9ea0.svg?style=social&colorA=999999&logo=github)](https://github.com/sbcl/sbcl/blob/master/src/code/target-format.lisp/) > Provides various facilities for formatting output. > CONTROL-STRING contains a string to be output, possibly with embedded > directives, which are flagged with the escape character "~". Directives > generally expand into additional text to be output, usually consuming one > or more of the FORMAT-ARGUMENTS in the process. A few useful directives > are: > ~A or ~nA Prints one argument as if by PRINC > ~S or ~nS Prints one argument as if by PRIN1 > ~D or ~nD Prints one argument as a decimal integer > ~% Does a TERPRI > ~& Does a FRESH-LINE > where n is the width of the field in which the object is printed. > > DESTINATION controls where the result will go. If DESTINATION is T, then > the output is sent to the standard output stream. If it is NIL, then the > output is returned in a string as the value of the call. Otherwise, > DESTINATION must be a stream to which the output will be sent. > > Example: (FORMAT NIL "The answer is ~D." 10) => "The answer is 10." > > FORMAT has many additional capabilities not described here. Consult the > manual for details. ### Lambda list ```cl (sb-format::destination sb-format::control-string &rest sb-format::format-arguments) ```