Articles in this section

toExponential helper

Use the toExponential helper to convert a numeric value (or a numeric string) into exponential (scientific) notation. You may optionally specify how many digits you want to show after the decimal point.

Usage

{{toExponential field fractionDigits}}
  • field: The numeric field or value to format (e.g., record.total or "12345").

  • fractionDigits (optional): How many digits to display after the decimal point.

Examples

  1. Formatting a record field 

    {{toExponential record.orderId 2}}

    If record.orderId is "12345", the output is "1.23e4".

  2. Specifying a literal 

    {{toExponential "3.14159265359" 6}}

    Produces "3.141593e+0", showing six digits after the decimal point.

  3. Using triple braces for raw output 

    {{{toExponential "12345" 2}}}

    Returns the unquoted exponential string, e.g., 1.23e4.

Tip

  • Make sure the input is a valid number (or numeric string). Otherwise, the result may be NaN.

  • The fractionDigits parameter is optional; if omitted, it defaults to however many digits JavaScript typically provides.

  • Consider whether you need raw or automatically formatted output. Triple braces ({{{ }}}) return the result without extra formatting.