gwp_calculate
The gwp_calculate Merge Tag returns the result of a calculation formula and formats the number as specified.
Options
formula (required) | The arithmetic expression to be calculated. Use field merge tags, e.g., {Number:5}, within the formula. |
number_format (optional, default = ‘decimal_dot’) | Specifies the format of the number. You can use decimal_comma , decimal_dot , or currency . |
thousands_sep (optional, default = true) | Determines whether to include a thousands separator. Set to false to disable.This option will be ignored for the currency format. |
raw (optional, default = false) | Output the number in decimal dot notation without any formatting. When true the other formatting options will be ignored. |
decimals (optional) | Integer value to set the number of decimals to round to. |
round (optional) | Set rounding options: round (default), ceil or floor |
Examples
{gwp_calculate formula="({Number:5}+{Number2:7})*{Number3:6}"}
Returns the calculated result based on the provided formula using decimal point formatting.
{gwp_calculate formula="({Number:5}+{Number2:7})*{Number3:6}" number_format=decimal_comma thousands_sep=false}
Returns the calculated result with decimal comma formatting, but without thousands separator.
{gwp_calculate formula="({Number:5}+{Number2:7})*{Number3:6}" number_format=currency}
Returns the calculated result formatted as currency. The thousands separator will be included according to the Gravity Forms currency settings.
{gwp_calculate formula="({Number:5}+{Number2:7})*{Number3:6}" raw=true}
Returns the calculated result in decimal dot notation without any formatting.
Last updated: 13-12-2024