adamsaghy commented on code in PR #6264:
URL: https://github.com/apache/fineract/pull/6264#discussion_r3880338617
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/domain/WorkingCapitalLoanPeriodPaymentRateChange.java:
##########
@@ -40,6 +41,20 @@
@Table(name = "m_wc_loan_period_payment_rate_change")
public class WorkingCapitalLoanPeriodPaymentRateChange extends
AbstractAuditableWithUTCDateTimeCustom<Long> {
+ /** Two rate changes on the same loan can differ only from the ninth
decimal of the EIR onwards. */
+ private static final int EIR_SCALE = 12;
+
+ private static final int AMOUNT_SCALE = 6;
+
+ /** The annualised rate is a headline figure; six decimals match the rate
columns either side of it. */
+ private static final int ANNUAL_EIR_SCALE = 6;
+
+ /**
+ * Fixed rather than the tenant's money rounding mode: these are rates and
derived figures, not money, and the whole
+ * point of pinning the scales here is that the same inputs yield the same
stored value for every tenant.
+ */
+ private static final RoundingMode SNAPSHOT_ROUNDING = RoundingMode.HALF_UP;
Review Comment:
HALF_EVEN is better for monetary operations:
_"It is widely known as Banker's Rounding or convergent rounding, and it
represents the default rounding logic specified by the IEEE 754 standard for
floating-point math"_
--
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]