calculateAPYInDaysWithCompound static method

double calculateAPYInDaysWithCompound(
  1. double moneySaving,
  2. double interestRate,
  3. int dayNumber
)

Implementation

static double calculateAPYInDaysWithCompound(
    double moneySaving, double interestRate, int dayNumber) {
  for (int i = 0; i < dayNumber; i++) {
    moneySaving += (moneySaving * interestRate / 100) / 365;
  }
  return moneySaving;
}