[FIX] Division by 0

This commit is contained in:
Sebastian Grewe 2013-12-02 17:13:09 +01:00
parent cdf0999178
commit 5edf88b2ee

View File

@ -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(