Functions:math

From Dwoo Docs

(Redirected from Math)
Jump to: navigation, search

Computes a mathematical equation

math(string $equation, [ string $format = "", [ string $assign = "", [ array $rest = array() ]]])

  • equation : the equation to compute, it can include normal variables with $foo or special math variables without the dollar sign
  • format : output format, see sprintf() for details
  • assign : if set, the output is assigned into the given variable name instead of being output
  • rest : all math specific variables that you use must be defined, see the example




Example:

{$c=2}
{math "(a+b)*$c/4" a=3 b=5} {* which translates to: ((3+5)*2/4) *}

Output :

4
Personal tools
templates
page language

French

The article you want to access doesn't exist in French.
Deutsch
The article you want to access doesn't exist in Deutsch.
Russian
The article you want to access doesn't exist in Russian.