[F] Fix max gpa calculation

This commit is contained in:
Hykilpikonna
2019-09-27 16:33:50 -04:00
parent 8e924d8e33
commit d8eb160123
+3 -2
View File
@@ -60,15 +60,16 @@ export class GPAUtils
// Count total GPA
let totalGPA = 0;
let maxGPA = 0;
let maxTotal = 0;
courses.forEach(course =>
{
totalGPA += this.getGP(course, course.letterGrade);
maxGPA += this.getGP(course, "A+");
maxTotal += this.getGP(course, "A+");
});
// Get average GPA, round to two decimal places
let gpa = Math.round(totalGPA / courses.length * 100) / 100;
let maxGPA = Math.round(maxTotal / courses.length * 100) / 100;
// Return results
return {gpa: gpa, accurate: accurate, max: maxGPA};