Fix cast error in PHP 8.0

This commit is contained in:
James Cole
2020-12-25 12:45:34 +01:00
parent 232cc39325
commit b34f16535c
2 changed files with 4 additions and 2 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((float) $leftOnAccount, 12), round($leftToSave, 12));
$maxAmount = (string)min(round((float) $leftOnAccount, 12), round((float)$leftToSave, 12));
$compare = bccomp($amount, $maxAmount);
$result = $compare <= 0;