Difference between revisions of "Sscalculation"

From SmartWiki
Jump to: navigation, search
 
Line 2: Line 2:
  
 
This works similar to sslogic but will do calculations based on the formula you provide.  It works as follows:
 
This works similar to sslogic but will do calculations based on the formula you provide.  It works as follows:
 +
 +
<pre>
  
 
<!--@sscalculation(@field@*0.05)-->
 
<!--@sscalculation(@field@*0.05)-->
 +
 +
</pre>
  
 
This will return the computed value of @field@*0.05 and replaces the sscalculation tag.
 
This will return the computed value of @field@*0.05 and replaces the sscalculation tag.

Revision as of 10:10, 11 March 2009

Sscalculation is a new variable syntax for Web Page Views, Store Value - System Variables, Read Only - System Variables.

This works similar to sslogic but will do calculations based on the formula you provide. It works as follows:


<!--@sscalculation(@field@*0.05)-->

This will return the computed value of @field@*0.05 and replaces the sscalculation tag.

This way you can do calculations right on the web page views without having to use javascript which solves the problem on PDF and javascript.

This method uses MySQL syntax, so you can do any MySQL functions like concat(...), format(...), round(...), etc.