Skip to content

Commit aeca604

Browse files
committed
Merge pull request #21 from Nyholm/patch-1
Make sure to round the ratio
2 parents 71b67e6 + f0a7c6d commit aeca604

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/DataCollector/CacheDataCollector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ private function calculateStatistics()
145145
}
146146
}
147147
if ($statistics[$name]['reads']) {
148-
$statistics[$name]['ratio'] = 100 * $statistics[$name]['hits'] / $statistics[$name]['reads'].'%';
148+
$statistics[$name]['ratio'] = round(100 * $statistics[$name]['hits'] / $statistics[$name]['reads'], 2).'%';
149149
} else {
150150
$statistics[$name]['ratio'] = 'N/A';
151151
}
@@ -167,7 +167,7 @@ private function calculateTotalStatistics()
167167
}
168168
}
169169
if ($totals['reads']) {
170-
$totals['ratio'] = 100 * $totals['hits'] / $totals['reads'].'%';
170+
$totals['ratio'] = round(100 * $totals['hits'] / $totals['reads'], 2).'%';
171171
} else {
172172
$totals['ratio'] = 'N/A';
173173
}

0 commit comments

Comments
 (0)