Use the toFixed helper to format a numeric value (or numeric string) to a fixed number of decimal places. It returns a string representing the rounded result.
{{toFixed field digits}}
-
field: A numeric field or literal (e.g.,
record.totalor123.456789). -
digits: The number of decimal places to display (0 or greater).
-
Formatting a record field
If
record.taxis29.7777, then:{{toFixed record.tax 2}}outputs
"29.78". -
Literal value with different decimal places
{{toFixed 123.456789 4}} → "123.4568" {{toFixed 123.456789 0}} → "123" -
Using triple braces for raw output
{{{toFixed record.discount 2}}}Returns the string without any automatic formatting or quotes (e.g.,
19.50).
Tip
-
If your input is not numeric or a numeric string,
toFixedmay produceNaN. -
Values are rounded to the specified number of decimal places.
-
Consider whether you want raw output (
{{{ }}}) or the platform’s default string formatting ({{ }}).