From 5edf88b2eefe4a56bbb84b05f988a08c06960590 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Mon, 2 Dec 2013 17:13:09 +0100 Subject: [PATCH] [FIX] Division by 0 --- public/include/pages/api/getdashboarddata.inc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/include/pages/api/getdashboarddata.inc.php b/public/include/pages/api/getdashboarddata.inc.php index c3877e75..c2e766f6 100644 --- a/public/include/pages/api/getdashboarddata.inc.php +++ b/public/include/pages/api/getdashboarddata.inc.php @@ -81,7 +81,11 @@ $aPrice = $setting->getValue('price'); // Round progress $iEstShares = $statistics->getEstimatedShares($dDifficulty); -$dEstPercent = round(100 / $iEstShares * $aRoundShares['valid'], 2); +if ($iEstShares > 0 && $aRoundShares['valid'] > 0) { + $dEstPercent = round(100 / $iEstShares * $aRoundShares['valid'], 2); +} else { + $dEstPercent = 0; +} // Output JSON format $data = array(