Help:Extension:ParserFunctions

The extension provides ten additional parser functions to supplement those already present in MediaWiki. All the parser functions provided by this extension take the form:
 *  

#if:

 *  

This function tests whether the first parameter is 'nonzero'. It evaluates to false if the test string is empty or contains only whitespace characters (space, newline, etc).


 *   &rarr;
 *   &rarr;
 *   &rarr;
 *   &rarr;

The test string is always interpreted as pure text, so mathematical expressions are not evaluated:


 *   &rarr;

Either or both the return values may be ommitted:


 *   &rarr;
 *  </tt> &rarr;
 *  </tt> &rarr;

#ifeq:
This parser function compares two strings and determines whether they are identically equal.


 *  </tt>

If both strings are valid numerical values, the strings are compared numerically:


 *  </tt> &rarr; 
 *  </tt> &rarr; 

Otherwise the comparison is made as text; this comparison is case sensitive:


 *  </tt> &rarr; 
 *  </tt> &rarr; 
 *  </tt> &rarr; 

#expr:
This function evaluates a mathematical expression and returns the calculated value.


 *  </tt>

The available operators are listed to the right, in order of precedence. See Help:Calculation for more details of the function of each operator. The accuracy and format of the result returned will vary depending on the operating system of the server running the wiki, and the number format of the site language.

When evaluating using boolean algebra, zero evaluates to false</tt> and any nonzero value, positive or negative, evaluates to true</tt>:


 *  </tt> &rarr;