[ar] [ast] [bg] [br] [ca] [co] [cpf] [cs] [da] [de] [en] [eo] [es] [eu] [fa] [fon] [fr] [gl] [id] [it] [ja] [lb] [nl] [oc] [pl] [pt] [ro] [ru] [sk] [sv] [tr] [uk] [vi] [zh] Espace de traduction



June 2010

All the versions of this article:

The |plus{xx} (French for "add") filter is a mathematical operation filter.
It returns the results of adding (the sum) the value of the tag and the xx argument passed to the filter.

If the tag’s output is not a numeric type, it will be considered as being 0 (zero) and the filter will simply return its own argument: [(#TEXTE|plus{18})] will return "18".

It is possible to assign a negative number as the argument to the filter: [(#TOTAL_BOUCLE|plus{-5.2})], but this would undoubtedly be more clear if we were instead to use the |moins (subtract) filter.

Warning: if xx is a floating point number, it must be written with a period as per the English method as opposed to being written with a comma as some European languages do: [(#TOTAL_BOUCLE|plus{5.2})].

See also the |modulo, |mult, |moins and |div filters.

Show the template of this page Site powered by SPIP | Translation area | Private area