The Format Number function returns a string that is a number formatted to fit the specified pattern.
Parameter: number
The number to format. This can come from a source node, the result of another function, or a value that you specify.
Parameter: string
Returns: string
The first parameter reformatted to reflect the pattern specified by the second parameter.
Patterns can have constant text as a prefix, suffix, or both. Common uses are to specify the currency symbol or some unit of measurement.
Example 1$#,##0.00 – formats a number in the standard format for United States dollars with the dollar sign, commas for separators and at least one dollar digit and two digits for cents.
format-number(12345.6789,'$#,##0.00') = '$12,345.67'#0.000% – formats a decimal number as a percentage with at least three decimal places.
format-number(.67890123,'#0.000%') = '67.890%'When the percent symbol is present, the input number is multiplied by 100.
Example 3#,##0.00;(#,##0.00) – formats negative number with parentheses, a format commonly used in accounting.
format-number(-12345.6789,'#,##0.00;(#,##0.00)') = '(12,345.67)'