Fix round() calls for PHP 8.0

This commit is contained in:
James Cole
2020-12-21 09:02:24 +01:00
parent fe66bb1984
commit 670bf26510
10 changed files with 18 additions and 18 deletions

View File

@@ -105,7 +105,7 @@ trait ModifiesPiggyBanks
$leftOnAccount = $this->leftOnAccount($piggyBank, today(config('app.timezone')));
$savedSoFar = (string)$this->getRepetition($piggyBank)->currentamount;
$leftToSave = bcsub($piggyBank->targetamount, $savedSoFar);
$maxAmount = (string)min(round($leftOnAccount, 12), round($leftToSave, 12));
$maxAmount = (string)min(round((float) $leftOnAccount, 12), round($leftToSave, 12));
$compare = bccomp($amount, $maxAmount);
$result = $compare <= 0;