Use multiply to return the product of two values. Each value can be a numeric field from the record or a string that can be parsed as a number. This is helpful for tasks such as computing extended prices (quantity * unitPrice), applying percentage-based discounts, or adjusting invoice totals.
{{multiply value1 value2}}
-
value1 and value2 can be numbers or numeric strings (e.g.,
"5","10.75"). -
The output is a numeric result of the multiplication.
-
Applying a discount
{{multiply record.total "0.9"}}If
record.totalis100, the output is90(a 10% discount). -
Calculating extended price
{{multiply record.quantity record.unitPrice}}If
record.quantityis"3"andrecord.unitPriceis19.99, the output is59.97. -
Combining hard-coded and dynamic values
{{multiply "5" record.items.length}}If
record.items.lengthis4, the output is20.
Tips
Tip
-
Make sure each value you pass in can be interpreted as a valid number. Non-numeric strings (like
"abc") result inNaN. -
Using double braces ({{ }}) vs. triple braces ({{{ }}}) for the output typically has minimal effect here, since the result is a numeric value.
-
When dealing with currency or decimals, confirm you pass properly formatted numeric strings (e.g.,
"9.99"). Otherwise, rounding errors can occur.