The toFixed helper formats a numeric value to a specified number of decimal places and returns the result as a string. Use it to normalize currency values, percentages, or any numeric output that requires a consistent decimal format.
Syntax
{{toFixed field digits}}
field -- The numeric value to format. Required. Accepts a number, numeric string, or field reference. Non-numeric values return NaN.
digits -- The number of decimal places to display. Required. Accepts 0 or greater. Values are rounded to the specified precision.
Examples
Format a field to two decimal places
{{toFixed record.tax 2}}
Input: record.tax is 29.7777
Output: 29.78
Format a literal value to different decimal places
{{toFixed 123.456789 4}}
Output: 123.4568
{{toFixed 123.456789 0}}
Output: 123
Return raw output with triple braces
{{{toFixed record.discount 2}}}
Use triple braces when downstream systems require the exact numeric string without Celigo's automatic formatting (e.g. 19.50 rather than "19.50").
Usage notes
- Values are rounded to the specified number of decimal places, not truncated.
- Non-numeric inputs return
NaN. - Use triple braces (
{{{ }}}) for raw output and double braces ({{ }}) when Celigo's default formatting is acceptable.