Replace deprecated method.

This commit is contained in:
James Cole
2022-03-27 20:24:13 +02:00
parent 8ee4c2ea11
commit cbf14f541c
39 changed files with 140 additions and 123 deletions

View File

@@ -50,7 +50,10 @@ class FrontpageController extends Controller
$amount = $repository->getCurrentAmount($piggyBank);
if (1 === bccomp($amount, '0')) {
// percentage!
$pct = round(($amount / $piggyBank->targetamount) * 100);
$pct = 0;
if(0.0 !== (float)$piggyBank->targetamount) {
$pct = round(($amount / $piggyBank->targetamount) * 100);
}
$entry = [
'id' => $piggyBank->id,