Fix division by zero

This commit is contained in:
James Cole
2023-04-28 08:39:30 +02:00
parent ea903c105d
commit 335414f25a

View File

@@ -83,8 +83,10 @@ class BudgetController extends Controller
if (null !== $availableBudget) {
$available = $availableBudget->amount;
if (0 !== bccomp($available, '0')) {
$percentage = bcmul(bcdiv($budgeted, $available), '100');
}
}
// if available, get the AB for this period + currency, so the bar can be redrawn.
return response()->json(