Convert to number.

This commit is contained in:
James Cole 2016-01-08 20:43:46 +01:00
parent b4c9a7698e
commit a3a1bc30b1

View File

@ -114,10 +114,10 @@ class ChartJsAccountChartGenerator implements AccountChartGenerator
]; ];
$current = clone $start; $current = clone $start;
$range = Steam::balanceInRange($account, $start, clone $end); $range = Steam::balanceInRange($account, $start, clone $end);
$previous = array_values($range)[0]; $previous = round(array_values($range)[0], 2);
while ($current <= $end) { while ($current <= $end) {
$format = $current->format('Y-m-d'); $format = $current->format('Y-m-d');
$balance = isset($range[$format]) ? $range[$format] : $previous; $balance = isset($range[$format]) ? round($range[$format], 2) : $previous;
$set['data'][] = $balance; $set['data'][] = $balance;
$previous = $balance; $previous = $balance;