Subtract
Subtracts one or more values from the first value and merges the result. Use it for remaining balances, discounts, or credits used.
Syntax
{{subtract value1 value2 ... precision=n culture="xx-XX"}}
Every value after the first is subtracted from it, so {{subtract 100 20 5}} merges 75.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| Values | Number | Required | The starting value, followed by one or more values to subtract from it. |
| precision | Number | Optional | Number of digits after the decimal point. When you set it, trailing zeros are kept. |
| culture | Text | Optional | The culture used to format the result. Defaults to your account's culture. |
Note: If a value is empty or is not a number, it counts as 0 and the rest of the calculation still runs.
Examples
The examples below are based on the following sample content:
Credit remaining: {{subtract Contact.creditLimit Contact.balance precision=2}}
A. Credit limit is 500, balance is 137.40
Credit remaining: 362.60
B. Balance is empty
Credit remaining: 500.00