Operators
Operators allow you to perform calculations and comparisons in Data Expressions.
Addition — +
Adds two numbers:
quantity + 5
price1 + price2
Also concatenates strings:
"Hello " + name
Subtraction — -
Subtracts one number from another:
quantity - 6
total - discount
Multiplication — *
Multiplies two numbers:
quantity * 3
quantity * price
Division — /
Divides one number by another.
Division by zero is not allowed.
percentage / 100
Modulo — %
Returns the remainder of a division:
index % 2
Greater than — >
Returns true if the first value is greater than the second:
price > 50
Greater than or equal — >=
Returns true if the first value is greater than or equal to the second:
price >= 50
Less than — <
Returns true if the first value is less than the second:
price < 50
Less than or equal — <=
Returns true if the first value is less than or equal to the second:
price <= 50
Assignment — =
Assigns the result of an expression to a variable.
If the variable does not exist, it is created and can be reused later in the template:
line_total = quantity * price
Equal — ==
Returns true if both values are equal:
price == 50
Not equal — !=, <>
Returns true if values are not equal:
price != 50
price <> 50
Was this article helpful?
Yes
No