public static function average($array = false, $decimals = 2) {

        if($array && Validate::isArray($array)) {

            return self::round((array_sum($array) / count($array)), $decimals); 
        }

        return false;
    }
public static function average($array = false, $decimals = 2) {

        if($array && Validate::isArray($array)) {

            return self::round((array_sum($array) / count($array)), $decimals); 
        }

        return false;
    }
public static function average ( $ array = false , $ decimals = 2 ) { if ( $ array && Validate :: isArray ( $ array ) ) { return self :: round ( ( array_sum ( $ array ) / count ( $ array ) ) , $ decimals ) ; } return false ; }
Get the average value of a given array.
@param array with values
@param int number of decimals
@return int || float
Get the average value of a given array .