Use the toPrecision helper to format a number (or numeric string) so that it has a specified number of significant digits. If the number of integer digits exceeds the precision, the output switches to scientific notation automatically.
{{toPrecision field precision}}
-
field: The numeric field or value to format.
-
precision: The desired number of significant digits.
-
Switching between regular and scientific notation
{{toPrecision 123.00 2}} → "1.2e+2" {{toPrecision 123.00 3}} → "123"When the integer part fits within the specified precision, the helper produces a standard decimal notation; otherwise, it uses exponential notation.
-
Handling larger numbers
{{toPrecision 123456 5}} → "1.2346e+5" {{toPrecision 1234567.00 6}} → "123456" -
Using a record field and triple braces
{{{toPrecision record.total 4}}}Returns the formatted result without Celigo’s automatic string wrapping, e.g.,
9.876e+3or9876depending on the value.
Tip
-
Ensure your input is numeric or a valid numeric string to avoid
NaN. -
Setting
precisiontoo low (e.g.,0or1) will quickly push even moderate numbers into exponential notation. -
Use triple braces (
{{{ }}}) if you need the exact raw output without additional formatting.