calculateAPYInMonthWithCompound static method

double calculateAPYInMonthWithCompound(
  1. double moneySaving,
  2. double interestRate,
  3. int monthNumber
)

Implementation

static double calculateAPYInMonthWithCompound(
    double moneySaving, double interestRate, int monthNumber) {
  for (int i = 0; i < monthNumber; i++) {
    moneySaving += (moneySaving * interestRate / 100) / 12;
  }
  return moneySaving;
}