average()
Table of Contents
Overview
The average() function takes numberList as an argument, and returns the average of numbers present in the list.
Return Type
- Decimal
Syntax
<variable> = <numberList>.average();
(OR)
<variable> = average(<numberList> );
Parameter | Description | Data type |
---|---|---|
<variable> | Variable which will contain the returned value. | DECIMAL |
<number> | The list from which the average value will be returned. Numerical values can be specified in double quotes. | NUMBER LIST or DECIMAL LIST |
Examples
numberList = {1, 5, 2, 3};
averageValue= numberList.average(); // returns 2.75
averageValue= numberList.average(); // returns 2.75