@travishorn/financejs
    Preparing search index...

    Function calculateCouponDaysBeforeSettlement

    • Returns the number of days from the beginning of the coupon period to the settlement date.

      Remarks:

      • settlement, maturity, frequency, and basis are truncated to integers.
      • If settlement or maturity is not a valid date, an error is thrown.
      • If frequency is any number other than 1, 2, or 4, an error is thrown.
      • If basis < 0 or if basis > 4, an error is thrown.
      • If settlement >= maturity, an error is thrown.

      Parameters

      • options: CouponDaysBeforeSettlementOptions

        The coupon days before settlement calculation options.

      Returns number

      The number of days from the beginning of the coupon period to the settlement date.

      calculateCouponDaysBeforeSettlement({
      settlement: new Date("2011-01-25"),
      maturity: new Date("2011-11-15"),
      frequency: 2,
      basis: 1,
      }); // 71