@travishorn/financejs
    Preparing search index...

    Function calculateDatedNetPresentValue

    • Calculates the net present value for a schedule of cash flows that is not necessarily periodic.

      Parameters

      • options: DatedNetPresentValueOptions

        The dated net present value calculation options.

      Returns number

      The net present value for the supplied rate and dated cash flows.

      When inputs are invalid.

      const cashFlows = [-10000, 2750, 4250, 3250, 2750];
      const dates = [new Date("2008-01-01"), new Date("2008-03-01"), new Date("2008-10-30"), new Date("2009-02-15"), new Date("2009-04-01")];
      calculateDatedNetPresentValue({ rate: 0.09, cashFlows, dates }); // 2086.647602031535
      calculateDatedNetPresentValue({
      rate: 0.05,
      cashFlows: [-5000, 1000, 2000, 3000, 4000],
      dates: [new Date("2020-01-01"), new Date("2020-06-01"), new Date("2021-01-01"), new Date("2021-06-01"), new Date("2022-01-01")],
      }); // 4311.704135504524