Operator - (Subtract)

Substracts the number on the right from the one on the left

Usage

left_value - right_value

Parameters

left_value

(Required) Value to substract from

right_value

(Required) Value to substract

Examples

Example With these variables Result

price - 2

price is 9.5

7.5

age1 - age2

age1 is 22
age2 is 25

-3

30 - 10 * 2

(None)

10

(10 - 5) * 2

(None)

10

5 - 10 / 2

(None)

0

(5 - 10) / 2

(None)

-2.5

More information

Multiple operators can be used. The order of operation is the same as in mathematics:

  • content of parentheses is evaluated first
  • then exponents are evaluated, from right to left
  • then multiplication and division are evaluated, from left to right
  • the remaining operators are then applied from left to right

Reminders

A text containing digits is not handled as a number. To have an actual number:

  • use the @NUMBER_QUESTION to set the variable
  • write a numeric value directly in the code without quotes, ex: age >= 18
  • use a function which converts to a number: NUMBER(text_containing_numbers)
  • use a function which returns a number: FIND("world", "hello everybody")

See also