Skip to content

Commit

Permalink
fixing error with charts median
Browse files Browse the repository at this point in the history
  • Loading branch information
dogmatic69 committed Nov 17, 2012
1 parent b5edea0 commit cef6f4e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Core/Charts/Lib/ChartDataManipulation.php
Expand Up @@ -225,8 +225,11 @@ protected function _median($values) {
sort($values);
$count = count($values);
$mid = intval($count / 2);
if($count % 2 == 0) {
return ((int)$values[$mid] + (int)$values[$mid - 1]) / 2;
}

return ($count % 2 == 0) ? ($values[$mid] + $values[$mid - 1]) / 2 : $values[$mid];
return (int)$values[$mid];
}

/**
Expand Down

0 comments on commit cef6f4e

Please sign in to comment.