Skip to content

Commit

Permalink
[fix] dailyGainRate 계산 로직 수정 (#262)
Browse files Browse the repository at this point in the history
* #260 fix: 퍼센티지 데이터를 정수타입에서 Double 타입으로 변경

* #260 test: 테스트 코드 수정

- 실수값 검증하도록 수정

* #260 fix: 메소드의 타입 변경

* #260 fix: dailyGainRate 수식 수정
  • Loading branch information
yonghwankim-dev authored Mar 6, 2024
1 parent 06e6838 commit 9992579
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ public Double calculateDailyGainRate(PortfolioGainHistory prevHistory) {
if (prevCurrentValuation == 0) {
double currentValuation = calculateTotalCurrentValuation().doubleValue();
double totalInvestmentAmount = calculateTotalInvestmentAmount().doubleValue();
if (totalInvestmentAmount == 0) {
return 0.0;
}
return ((currentValuation - totalInvestmentAmount) / totalInvestmentAmount) * 100;
}
double currentValuation = calculateTotalCurrentValuation();
Expand Down

0 comments on commit 9992579

Please sign in to comment.