Template:Sum

From Wikipedia, the free encyclopedia

Below is the documentation of this template. See the lists of templates on Wikipedia.
Purge server cache if the template uses noinclude, and your changes does not appear..

This basic template just evaluated and returns the sum of its parameters (up to 4). Missing or empty parameters are ignored (treated like zero). The parameters can also be numeric expressions that will be evaluated before adding them (this alternate form allows adding more values and simplifies the use of this template in other computing templates). This template returns 0 if all parameters are empty or missing.

Syntax:
{{Sum|[value1]|[value2]|[value3]|[value4]}}
Note:
Using this template is generally not necessary, as the following syntaxes are similar and equivalent:
  • {{Sum|value1|value2}}
  • {{Sum|value1+value2}}
  • {{#expr:value1+value2}}
Use this template only for parameters that may be conditionally empty as they are tested and ignored.
See also: