Package

ViewHelpers

ViewHelper Documentation

v:math.average

Math: Average

Performs average across an array. If $a is an array and $b is an array, each member of $a is averaged against the same member in $b. If $a is an array and $b is a number, each member of $a is averaged agained $b. If $a is an array this array is averaged to one number. If $a is a number and $b is not provided or NULL, $a is gracefully returned as an average value of itself.

Arguments

a anySimpleType

First number for calculation

fail boolean

If TRUE, throws an Exception if argument "a" is not specified and no child content or inline argument is found. Usually okay to use a NULL value (as integer zero).

b anySimpleType

Optional: Second number or Iterator/Traversable/Array for calculation

ViewHelper Resources

Schema Resources