Fix division by zero.

This commit is contained in:
James Cole 2017-12-17 14:58:33 +01:00
parent 859b6fcea8
commit c1e1da12c2
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -302,6 +302,9 @@ class BudgetController extends Controller
$currentStart = app('navigation')->addPeriod($currentStart, $range, 0);
++$count;
}
if ($count === 0) {
$count = 1;
}
$result['available'] = bcdiv($total, strval($count));
// amount earned in this period: