Skip to content

Commit 22c5a24

Browse files
committed
issue #104 finished i think
1 parent 8068afd commit 22c5a24

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

protected/views/profile/record.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,14 @@
3535
}
3636

3737
}
38-
$finalGPA=$sum/$creditTotal;
39-
$finalGPA=round($finalGPA,2);
40-
echo "<h2>";
38+
if($creditTotal>0) {
39+
$finalGPA = $sum / $creditTotal;
40+
$finalGPA = round($finalGPA, 2);
41+
echo "<h2>";
4142

42-
echo "Total GPA: $finalGPA";
43-
echo "</h2>";
43+
echo "Total GPA: $finalGPA";
44+
echo "</h2>";
45+
}
4446

4547
?>
4648

0 commit comments

Comments
 (0)