Skip to content

Commit 386dd9b

Browse files
committed
other: rounding gpa to 2 decimal places
1 parent 37232fe commit 386dd9b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/main/java/org/shirakawatyu/handixikebackend/api/impl/MatrixScoreApi.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ private GradePointAverage calculateGPA(ArrayList<Score> scores) {
7979
}
8080
gpa = gpa / totalCredits;
8181
requiredGpa = requiredGpa / requiredCredits;
82+
83+
gpa = Math.round(gpa * 100.0) / 100.0;
84+
requiredGpa = Math.round(requiredGpa * 100.0) / 100.0;
8285
return new GradePointAverage(gpa, requiredGpa);
8386
}
8487
}

0 commit comments

Comments
 (0)