format
format formatString ?arg ...?
Makes a string from a template, as printf of C does. %s is a string, %d an integer, %f, %e, and %g a float, %x hexadecimal, %c a character from its code, and %% a percent sign. A flag such as -, 0, or +, a width, and a precision go between % and the letter. %2$s takes the second argument.
Examples
A click on an example runs it in the shell of the page.
format "%-5s|%05.1f" ab 3.14159:ab |003.1format %x 255:ff
Errors
format %d abcgives the errorexpected integer but got "abc"
Facts
- Capability: none.
- Compute cost: one compute unit for the call, and more for the commands that it runs.