Skip to main content

Logic/Math

Expressions can be used to do math and logic directly within templates.

Math
  • + Adds two objects together (the operands are casted to numbers).

    • {{ 1 + 1 }} is 2
  • - Subtracts the second number from the first one.

    • {{ 3 - 2 }} is 1
  • / Divides two numbers. The returned value will be a floating point number.

    • {{ 1 / 2 }} is 0.5
  • * Multiplies the left operand with the right one.

    • {{ 2 * 2 }} would return 4
Logic
  • and Returns true if the left and the right operands are both true.

  • or Returns true if the left or the right operand is true.

  • not Negates a statement.

  • (expr) Groups an expression.