Resolved division by 0 error that occurs in a weekly report for the first week of use where no previous data exists.

This commit is contained in:
bogey3
2023-02-27 13:27:30 -05:00
committed by GitHub
parent 5d58953e68
commit b0e2a1caa4
+4
View File
@@ -100,6 +100,7 @@ if(isset($_GET['ascii'])) {
$priorweekcount = $totalcount['COUNT(*)'];
// really percent changed
if($priorweekcount > 0){
$percentagediff = round( (($scount - $priorweekcount) / $priorweekcount) * 100 );
if($percentagediff > 0) {
@@ -109,6 +110,9 @@ if(isset($_GET['ascii'])) {
}
echo $com_name." - ".$scount." (".$percentagediff.")<br>";
} else {
echo $com_name." - ".$scount ."<br>";
}
}
}