expression required default (empty)The arithmetic expression to evaluate. Operators: + - * / % (modulo) and the bitwise operators & | ^ - note ^ is XOR, not a power operator. Parentheses group sub-expressions. Spaces and commas are stripped before evaluation and a comma is read as a decimal point. Letters are not allowed (no function names), so an invalid expression formats as 0. Nest a field lookup to compute on stored slice data.
decimals optional default (empty - raw value, no formatting)Number of decimal places to round and format the result to. Pass the literal value bool instead to return the translated Yes (when the result is non-zero) or No (when it is zero). If a separator is set but this is left empty, it defaults to 0 decimals.
dec_point optional default (empty; becomes a comma when a thousands separator is set)The decimal point character. Alternatively pass a locale code in this position: FR (comma decimal, thin-space thousands), EN (dot decimal, thin-space thousands) or US (dot decimal, comma thousands). Setting this switches on grouped number formatting.
thousands_sep optional default (empty)The thousands (grouping) separator. Setting either this or dec_point switches on grouped number formatting; with formatting on but no decimals given, 0 decimals are used.
emptytext optional default (empty)Text returned unchanged when the expression is empty or contains only whitespace. Useful for showing a placeholder such as -- in place of an unfilled number field.
{math:2^10}
{math:{item:5726c2c6b035d7aab450d1794e9e90d7:_#NUMBER__}*1.21:2}
{math:478778:1:,: }
{math:2+3*4}
{math:(2+3)*4}
{math:1 421,823 }
{math:10/3:2}
{math:1234567.89:2:US}
{math:478778:bool}