@gibme/finance
    Preparing search index...

    Variable default

    default: {
        calculate_amortization_loan: (
            principal: number,
            apr: number,
            months: number,
            extra_monthly_payments?: ExtraPaymentInformation[],
            fixed_payment?: boolean,
            digits?: number,
        ) => Readonly<AmortizationLoan>;
        calculate_amortization_payment: (
            principal: number,
            apr: number,
            months: number,
            fixed_payment?: number,
            digits?: number,
        ) => Readonly<AmortizationPayment>;
        calculate_amortization_table: (
            principal: number,
            apr: number,
            months: number,
            extra_monthly_payments?: ExtraPaymentInformation[],
            fixed_payment?: boolean,
            digits?: number,
        ) => Readonly<AmortizationTablePaymentEntry>[];
        calculate_apy: (apr: number, compound: CompoundPeriod) => number;
        calculate_cma: (values: number[], decimals?: number) => number[];
        calculate_compound_interest: (
            principal: number,
            apr: number,
            compound: CompoundPeriod,
            months: number,
            digits?: number,
        ) => number;
        calculate_ema: (
            values: number[],
            period: number,
            decimals?: number,
        ) => number[];
        calculate_ewma: (
            values: number[],
            lambda?: number,
            decimals?: number,
        ) => number[];
        calculate_lwma: (
            values: number[],
            period: number,
            decimals?: number,
        ) => number[];
        calculate_margin: (cost: number, selling_price: number) => number;
        calculate_markup: (cost: number, selling_price: number) => number;
        calculate_present_value_from_future_value: (
            future_value: number,
            apr: number,
            years: number,
            digits?: number,
        ) => number;
        calculate_principal_from_amortization_payment: (
            payment: number,
            apr: number,
            months: number,
            digits?: number,
        ) => number;
        calculate_simple_interest: (
            principal: number,
            apr: number,
            months: number,
            digits?: number,
        ) => number;
        calculate_simple_interest_loan: (
            principal: number,
            apr: number,
            months: number,
            digits?: number,
        ) => Readonly<SimpleInterestLoan>;
        calculate_sma: (
            values: number[],
            period: number,
            decimals?: number,
        ) => number[];
    }

    Type Declaration

    • calculate_amortization_loan: (
          principal: number,
          apr: number,
          months: number,
          extra_monthly_payments?: ExtraPaymentInformation[],
          fixed_payment?: boolean,
          digits?: number,
      ) => Readonly<AmortizationLoan>

      Calculates loan information using the amortization formula

      Note: This is akin to a mortgage calculator

    • calculate_amortization_payment: (
          principal: number,
          apr: number,
          months: number,
          fixed_payment?: number,
          digits?: number,
      ) => Readonly<AmortizationPayment>

      Calculates the payment, interest portion of that payment, principal portion of that payment, and remaining balance after that payment of an amortization loan

    • calculate_amortization_table: (
          principal: number,
          apr: number,
          months: number,
          extra_monthly_payments?: ExtraPaymentInformation[],
          fixed_payment?: boolean,
          digits?: number,
      ) => Readonly<AmortizationTablePaymentEntry>[]

      Calculates the amortization table given the supplied principal, interest rate, number of months of the loan, and any additional extra monthly payment information

    • calculate_apy: (apr: number, compound: CompoundPeriod) => number

      Calculates the Annual Percentage Yield (APY) given the rate and the compounding period

    • calculate_cma: (values: number[], decimals?: number) => number[]

      Calculate the Cumulative Moving Average (CMA) of the values provided

    • calculate_compound_interest: (
          principal: number,
          apr: number,
          compound: CompoundPeriod,
          months: number,
          digits?: number,
      ) => number

      Calculates the future value of the principal amount given the specified rate, the compounding cycle, and the number of months in which the principal is accruing interest using the compound interest formula

    • calculate_ema: (values: number[], period: number, decimals?: number) => number[]

      Calculate the Exponential Moving Average (EMA) of the values provided

    • calculate_ewma: (values: number[], lambda?: number, decimals?: number) => number[]

      Calculate the Exponentially Weighted Moving Average (EWMA) of the values

    • calculate_lwma: (values: number[], period: number, decimals?: number) => number[]

      Calculate the Linearly Weighted Moving Average (LWMA) of the values provided

    • calculate_margin: (cost: number, selling_price: number) => number

      Calculate the markup on a product

    • calculate_markup: (cost: number, selling_price: number) => number

      Calculate the margin on a product

    • calculate_present_value_from_future_value: (future_value: number, apr: number, years: number, digits?: number) => number

      Calculate the present value of a future value with a constant rate of return over a number of years

    • calculate_principal_from_amortization_payment: (payment: number, apr: number, months: number, digits?: number) => number

      Calculates the initial principal balance given the payment amount, the interest rate, and the number of months of the loan

    • calculate_simple_interest: (principal: number, apr: number, months: number, digits?: number) => number

      Calculates the future value of the principal amount given the specified rate and the number of months in which the principal is accruing interest using the simple interest formula

    • calculate_simple_interest_loan: (
          principal: number,
          apr: number,
          months: number,
          digits?: number,
      ) => Readonly<SimpleInterestLoan>

      Calculates loan information using the simple interest formula

    • calculate_sma: (values: number[], period: number, decimals?: number) => number[]

      Calculate the Simple Moving Average (SMA) of the values provided