Skip to content

Firefly III: a personal finances manager

Add rounding, so the number will be a float.

James Colee7d677bfb62a
diff --git a/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php b/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php
index 998eea8bb9..7e3edf4d06 100644
--- a/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php
+++ b/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php
@@ -24,13 +24,13 @@ class ChartJsBillChartGenerator implements BillChartGenerator
bcscale(2);
$data = [
[
- 'value' => $unpaid,
+ 'value' => round($unpaid,2),
'color' => 'rgba(53, 124, 165,0.7)',
'highlight' => 'rgba(53, 124, 165,0.9)',
'label' => trans('firefly.unpaid'),
],
[
- 'value' => $paid * -1, // paid is negative, must be positive.
+ 'value' => round($paid * -1,2), // paid is negative, must be positive.
'color' => 'rgba(0, 141, 76, 0.7)',
'highlight' => 'rgba(0, 141, 76, 0.9)',
'label' => trans('firefly.paid'),