mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fix extremely specific piggy bank percentage.
This commit is contained in:
parent
5d1c77cb16
commit
6db0efdfbc
@ -204,7 +204,7 @@ class PiggyBankController extends Controller
|
||||
foreach ($collection as $piggyBank) {
|
||||
|
||||
$piggyBank->savedSoFar = $piggyRepository->getCurrentAmount($piggyBank);
|
||||
$piggyBank->percentage = 0 !== bccomp('0', $piggyBank->savedSoFar) ? (int)$piggyBank->savedSoFar / $piggyBank->targetamount * 100 : 0;
|
||||
$piggyBank->percentage = (int)(0 !== bccomp('0', $piggyBank->savedSoFar) ? $piggyBank->savedSoFar / $piggyBank->targetamount * 100 : 0);
|
||||
$piggyBank->leftToSave = bcsub($piggyBank->targetamount, (string)$piggyBank->savedSoFar);
|
||||
$piggyBank->percentage = $piggyBank->percentage > 100 ? 100 : $piggyBank->percentage;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user