XML Script logo
Function avg
Name

avg

Returns

number

Parameter count

1

Parameter 1

item, a pointer(s)

Description

This function converts the contents of all the 'item' items to numbers, and returns their average (mean). e.g.
<foo value="1" /><foo value="2" /><foo value="3" /><foo value="4" />
# average($foo.value) # returns 2.5
This functions is aliased as both avg and average.

Examples of use

                                
                        

XML Script homepage | Documentation home | XML Script docs | Command list | Function list | X-Tract docs

X-Stream, X-Tract and XML Script are trade marks of DecisionSoft Limited
© Copyright 1998-2000 DecisionSoft Limited