src/Utility/Number.php
public static function average($values, $precision = 0) {
		if (empty($values)) {
			return 0.0;
		}
		return round(array_sum($values) / count($values), $precision);
	}
public static function average($values, $precision = 0) {
		if (empty($values)) {
			return 0.0;
		}
		return round(array_sum($values) / count($values), $precision);
	}
public static function average ( $ values , $ precision = 0 ) { if ( empty ( $ values ) ) { return 0.0 ; } return round ( array_sum ( $ values ) / count ( $ values ) , $ precision ) ; }
Get the rounded average.

@param array $values Values: int or float values
@param int $precision
@return float Average
Get the rounded average .