mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-21 09:00:07 +00:00
Merge pull request #7438 from firefly-iii/division-by-zero
Fix division by zero
This commit is contained in:
@@ -82,8 +82,10 @@ class BudgetController extends Controller
|
|||||||
$percentage = '0';
|
$percentage = '0';
|
||||||
|
|
||||||
if (null !== $availableBudget) {
|
if (null !== $availableBudget) {
|
||||||
$available = $availableBudget->amount;
|
$available = $availableBudget->amount;
|
||||||
$percentage = bcmul(bcdiv($budgeted, $available), '100');
|
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.
|
// if available, get the AB for this period + currency, so the bar can be redrawn.
|
||||||
|
|||||||
Reference in New Issue
Block a user