Skip to content

Commit

Permalink
fix: 0으로 나누는 일이 발생하지 않도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Sangwook02 committed Oct 6, 2024
1 parent b60e067 commit 4dbd45f
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@ public static StudyStudentResponse of(
isOutstandingStudent(FIRST_ROUND_OUTSTANDING_STUDENT, studyAchievements),
isOutstandingStudent(SECOND_ROUND_OUTSTANDING_STUDENT, studyAchievements),
studyTodos,
(double) successAssignmentsCount * 100 / (assignments.size() - cancelledAssignmentsCount),
(double) (attendedCount * 100) / (attendances.size() - cancelledAttendanceCount));
assignments.size() != cancelledAssignmentsCount
? (double) successAssignmentsCount * 100 / (assignments.size() - cancelledAssignmentsCount)
: 0,
attendances.size() != cancelledAttendanceCount
? (double) (attendedCount * 100) / (attendances.size() - cancelledAttendanceCount)
: 0);
}

private static boolean isOutstandingStudent(
Expand Down

0 comments on commit 4dbd45f

Please sign in to comment.