From a3a1bc30b1297c53b1c43a78c80c7e4de65e6c82 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 8 Jan 2016 20:43:46 +0100 Subject: [PATCH] Convert to number. --- app/Generator/Chart/Account/ChartJsAccountChartGenerator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Generator/Chart/Account/ChartJsAccountChartGenerator.php b/app/Generator/Chart/Account/ChartJsAccountChartGenerator.php index 20f59a922d..4e446f617b 100644 --- a/app/Generator/Chart/Account/ChartJsAccountChartGenerator.php +++ b/app/Generator/Chart/Account/ChartJsAccountChartGenerator.php @@ -114,10 +114,10 @@ class ChartJsAccountChartGenerator implements AccountChartGenerator ]; $current = clone $start; $range = Steam::balanceInRange($account, $start, clone $end); - $previous = array_values($range)[0]; + $previous = round(array_values($range)[0], 2); while ($current <= $end) { $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; $previous = $balance;