Page tree
Skip to end of metadata
Go to start of metadata


Short conditional statements can be inserted with the ternary operator "a ? b : c." This works like an if-else statement: if the condition "a" evaluates true, then insert "b;" if "a" is false, insert "c." You must provide all parameters for the ternary operator to function, even if one parameter simply inserts a blank space.


$formula($condition ? "True Output" : "False output")


In this example the statement compares the variable $n to the value 1. If it is 1, "$n is 1" is shown. If it's not 1, "$n is not 1" is shown.

($n==1) ? "$n is 1" : "$n is not 1"

  • No labels