User Tools

Site Tools


en:public:developer:template_system:tags:expression:calc

Table of Contents

<#Calc>

A parser, compiler and interpreter for mathematical expressions. It can handle normal arithmetics (includings powers wit ^) and builtin functions like sin(). Multiplication *, division / and modulo mod have the same precedence, and are evaluated left to right.

NOTE: the input always use the '.' as decimalseparator. The output use the decimalseparator of the current language

Parameters

Name Mandatory Description
Expression Yes The expression to evaluate. The tags in the expression are always evaluated before the expression is calculated

Example

<#var name=MyNumber Value=100>
<#var name=MyNumber> mod 10 = <#calc expression="<#var name=MyNumber> mod 10">

The above example will output:

100 mod 10 = 10
en/public/developer/template_system/tags/expression/calc.txt · Last modified: 2015/02/05 16:06 by svanderclock