format. Outputting number in specified format

^name.format[format string]

The method outputs variable's value in specified format (see Format Strings).

When you output number without
format, simply:
$name
Parser for numbers with zero fraction part does this:
^name.format[%.0f]    [3.1.5]
for others that:
^čě˙.format[%g]

Examples
Code…

$var(15.67678678)
^var.format[%.2f]


…will return:
15.68

Code…

$var(0x123)
^var.format[0x%04X]


…will return:
0x0123


Copyright © 1997–2021 Art. Lebedev Studio | http://www.artlebedev.com Last updated: 20.09.2007