$average

Calculates the average value of all given numbers.
Syntax
    $average {numeric_value_1}{numeric_value_2} ... {numeric_value_n}
DocumentationCalculates the average value of all given parameters:

    Parameters:
      numeric_value_1, ..., numeric_value_n, the numeric values whos average value is requested.
    Returns:
      the average value of all given parameters.
    Throws:
      java.lang.NumberFormatException if any parameter is non numeric.
Examples
Calculate the average value of all numbers in range of 1 through 10:

    $average{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}

Alternative impementation using $add and $divide:

    $set{length}{0}
    $set{sum}{0}

    $for {$set{counter}{1}} {$lessOrEqual{$get{counter}}{$get{length}}} {$incLocal{counter}}
      {
      $set{sum}{$add{$get{sum}}{$get{counter}}}
      }

    $set{average}{$divide{$get{sum}}{$get{length}}}
GroupMath
Minimum required transaction-mode:NONE
Required scripting permission of the developerPERMISSION_FL_BASIC
Minimum parameters2
Maximum parameters <unlimited>