mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-11-22 08:56:39 -06:00
Merge pull request #7438 from firefly-iii/division-by-zero
Fix division by zero
This commit is contained in:
commit
222387adba
@ -82,8 +82,10 @@ class BudgetController extends Controller
|
||||
$percentage = '0';
|
||||
|
||||
if (null !== $availableBudget) {
|
||||
$available = $availableBudget->amount;
|
||||
$percentage = bcmul(bcdiv($budgeted, $available), '100');
|
||||
$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.
|
||||
|
Loading…
Reference in New Issue
Block a user