format#
Format a value of any type as string.
Available in: math cells, REPL.
Syntax#
format(value)
format(value, precision)
Arguments and behavior#
Returns the value as text. With a precision argument it rounds to that many decimals, so format(1/3, 4) is 0.3333. Notation controls apply here too, and this overrides the app-wide display setting for that expression only.
Example#
Edit the inputs, then use Run or Reset. Changes stay in this example.
Example
format(2.3)Interactive examples could not load. You can still copy the expressions.
Expected result: "2.3".