User Tools

Site Tools


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

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en:public:developer:template_system:tags:expression:calc [2012/11/19 11:44]
admin [Parameters]
en:public:developer:template_system:tags:expression:calc [2015/02/05 16:06] (current)
svanderclock [<#Calc>]
Line 1: Line 1:
-===== <#Calc> =====+====== <#Calc> ======
  
 A parser, compiler and interpreter for mathematical expressions. It can handle normal arithmetics (includings powers wit ^) and builtin functions like sin(). 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.  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 
  
  
Line 8: Line 10:
  
 ^ Name                                                       ^ Mandatory ^ Description ^        ^ Name                                                       ^ Mandatory ^ Description ^       
-| <html><span style="color:#008000">Expression</span></html> | Yes       | The expression to evaluate. The tags in the condition are always evaluated before the condition is calculated |+| <html><span style="color:#008000">Expression</span></html> | Yes       | The expression to evaluate. The tags in the expression are always evaluated before the expression is calculated |
  
 ==== Example ==== ==== Example ====
  
 <code> <code>
-<#url_PageNumber> mod 10 = <#calc expression="<#url_PageNumber> mod 10">+<#var name=MyNumber Value=100> 
 +<#var name=MyNumber> mod 10 = <#calc expression="<#var name=MyNumber> mod 10"> 
 +</code> 
 + 
 +The above example will output:  
 + 
 +<code> 
 +100 mod 10 = 10
 </code> </code>
en/public/developer/template_system/tags/expression/calc.1353311096.txt.gz · Last modified: 2012/11/19 11:44 by admin