-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DDING-97] 동아리 지원 폼지 통계 전체조회 API 구현 (#242)
- Loading branch information
Showing
21 changed files
with
1,214 additions
and
203 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
src/main/java/ddingdong/ddingdongBE/common/utils/CalculationUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package ddingdong.ddingdongBE.common.utils; | ||
|
||
public class CalculationUtils { | ||
|
||
public static int calculateRatio(int numerator, int denominator) { | ||
if (denominator == 0) { | ||
return 0; | ||
} | ||
return (int) ((double) numerator / denominator * 100); | ||
} | ||
|
||
public static int calculateDifference(int beforeCount, int count) { | ||
return count - beforeCount; | ||
} | ||
|
||
public static int calculateDifferenceRatio(int beforeCount, int count) { | ||
int difference = calculateDifference(beforeCount, count); | ||
return calculateRatio(difference, beforeCount); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.