Skip to content

Commit

Permalink
Merge pull request #339 from ssfinney/fixRoundingOnLocReport
Browse files Browse the repository at this point in the history
Fix rounding on loc report
  • Loading branch information
UFOMelkor authored May 24, 2018
2 parents 57c7386 + a32516e commit 8c609bc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Hal/Report/Html/template/loc.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<?php
// calculate percentiles
function procentile($arr, $percentile = 0.95)
function percentile($arr, $percentile = 0.95)
{
sort($arr);
return $arr[round($percentile * count($arr) - 1.0 - $percentile)];
Expand All @@ -23,8 +23,8 @@ function procentile($arr, $percentile = 0.95)
$range = range(0.5, 1, .05);
foreach ($range as $percentile) {
$json[] = (object)[
'lloc' => procentile($array, $percentile),
'percentile' => $percentile * 100,
'lloc' => percentile($array, $percentile),
'percentile' => round($percentile * 100),
];
}
}
Expand Down

0 comments on commit 8c609bc

Please sign in to comment.