adamsaghy commented on code in PR #4837:
URL: https://github.com/apache/fineract/pull/4837#discussion_r2212793928


##########
fineract-core/src/main/java/org/apache/fineract/portfolio/savings/domain/interest/EndOfDayBalance.java:
##########
@@ -81,9 +88,40 @@ public BigDecimal calculateInterestOnBalance(final 
BigDecimal interestToCompound
                 final BigDecimal dailyInterestRate = 
overdraftInterestRateAsFraction.multiply(multiplicand, MathContext.DECIMAL64);
                 final BigDecimal periodicInterestRate = 
dailyInterestRate.multiply(BigDecimal.valueOf(this.numberOfDays),
                         MathContext.DECIMAL64);
-                interest = 
realBalanceForInterestCalculation.multiply(periodicInterestRate, 
MathContext.DECIMAL64).setScale(9,
+                interest = 
realBalanceForInterestCalculation.multiply(periodicInterestRate, 
MathContext.DECIMAL64).setScale(this.decimals,
+                        MoneyHelper.getRoundingMode());
+            }
+        }
+        return interest;
+    }
+
+    public BigDecimal calculateInterestOnBalanceNegative(final BigDecimal 
interestToCompound, final BigDecimal interestRateAsFraction,
+            final long daysInYear, final BigDecimal 
minBalanceForInterestCalculation, final BigDecimal 
overdraftInterestRateAsFraction,
+            final BigDecimal minOverdraftForInterestCalculation) {
+
+        BigDecimal interest = BigDecimal.ZERO.setScale(this.decimals, 
MoneyHelper.getRoundingMode());

Review Comment:
   Why to set rounding mode and scale of zero value?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to