@travishorn/financejs
    Preparing search index...

    Function calculatePeriods

    • Calculates the number of periods for an investment based on periodic, constant payments and a constant interest rate.

      Remarks:

      • Make sure that you are consistent about the units you use for specifying rate. If you make monthly payments on a four-year loan at an annual interest rate of 12 percent, use 0.12 / 12 for rate. If you make annual payments on the same loan, use 0.12 for rate.
      • A result of -0 is normalized to 0.

      Parameters

      • options: PeriodsOptions

        The periods calculation options.

      Returns number

      Number of periods.

      When calculation is impossible with the provided inputs.

      calculatePeriods({
      rate: 0.12 / 12,
      payment: -100,
      presentValue: -1000,
      futureValue: 10000,
      timing: "beginning",
      }); // 59.67386567429468
      calculatePeriods({
      rate: 0.00166666666666667,
      payment: 500,
      presentValue: -25000,
      }); // 52.25031980741783