Skip to content

Commit

Permalink
Fixed issue: prevent "Division by zero" in statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
twilligls committed Mar 30, 2023
1 parent 6ed2405 commit 09f3940
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion application/helpers/admin/statistics_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2641,7 +2641,7 @@ protected function displayResults($outputs, $results, $rt, $outputType, $surveyi
//we want to have some "real" data here
if ($gdata[$i] != "N/A") {
//calculate percentage
$gdata[$i] = ($grawdata[$i] / $TotalCompleted) * 100;
$gdata[$i] = $TotalCompleted !== 0 ? ($grawdata[$i] / $TotalCompleted) * 100 : 0;
}
}

Expand Down

0 comments on commit 09f3940

Please sign in to comment.