getMonthlyEMI function

double getMonthlyEMI(
  1. double amount,
  2. Decimal rate,
  3. int tenure
)

Implementation

double getMonthlyEMI(double amount, Decimal rate, int tenure) {
  double perRate = rate.toDouble() / 1200;
  double emiAmount =
      amount * perRate / (1 - Math.pow((1 / (1 + perRate)), tenure));
  return getRoundedValue(emiAmount, 2);
}