Numeric conditional. Compares a value (the etalon) against one or more test values using a single comparison operator, and returns the output paired with the first test value that matches. If nothing matches, the trailing else text is returned.
Comparison is always numeric (also for security reasons). The etalon (etalon) and every test value (value1, value2, ...) are converted to a float before comparing: spaces are stripped and a comma is read as the decimal point, so 1 000,5 becomes 1000.5. Any non-numeric string converts to 0 - so comparing two words always sees 0 against 0. For text equality use ifeq instead.
Operators (the etalon is the left-hand side):
= == eq - equal<> != ne - not equal> gt - greater than>= ge - greater than or equal< lt - less than<= le - less than or equalAn unknown operator never matches, so the else text is returned. The aliases are ge and le - not gte/lte.
Multiple pairs: after the operator you may chain as many value:text pairs as you like. They are tested top to bottom and the first match wins, like a numeric switch. A final unpaired argument is the else text; if it is omitted and nothing matches, the result is empty.
Placeholders in the output: inside the returned text, _#1 is replaced by the etalon (as a normalized number) and _#2 by the first test value. The output may also contain any other AA expression.
Runtime-dependent: this command is never cached, since it usually compares live values.
Source: AA_Stringexpand_If in include/stringexpand.php.
etalon requiredThe value to test (left-hand side). Usually a number or the result of another expression. It is converted to a float before comparing - a comma is read as the decimal point and spaces are stripped; any non-numeric string becomes 0.
operator requiredThe comparison operator. Accepted: = == eq (equal), <> != ne (not equal), > gt (greater than), >= ge (greater than or equal), < lt (less than), <= le (less than or equal). The aliases are ge and le, not gte/lte. Any other value never matches, so the else text is returned.
value1 optionalThe first test value (right-hand side) compared against the etalon using the operator. Like the etalon it is converted to a float, so it is read numerically. If the comparison is true, text1 is returned.
text1 optionalThe output returned when the etalon compared with value1 is true. May be plain text, a number, contain the placeholders _#1 (etalon) and _#2 (value1), or any other AA expression.
value2:text2:... (optional pairs) optionalOptional further value:text pairs after the first one. They are tested top to bottom and the first matching pair wins, like a numeric switch. Add as many pairs as you need before the else text.
else_text optionalThe trailing unpaired argument: the output returned when no value matches. Optional - if it is omitted and nothing matches, the result is an empty string. May contain _#1, _#2, or other AA expressions.
{if:5:>:3:yes:no}
{if:3:>:10:big:5:medium:small}
{if:7:=:7:equal:different}
{if:7:>:10:high:5:medium:low}
{if:1,5:>:1:yes:no}
{if:42:>:0:answer is _#1:unknown}