Documentation

Interest
in package

Table of Contents

Constants

FINANCIAL_MAX_ITERATIONS  = 128
FINANCIAL_PRECISION  = 1.0E-8

Methods

payment()  : string|float
IPMT.
rate()  : string|float
RATE.
schedulePayment()  : string|float
ISPMT.
rateNextGuess()  : string|float

Constants

FINANCIAL_MAX_ITERATIONS

private mixed FINANCIAL_MAX_ITERATIONS = 128

FINANCIAL_PRECISION

private mixed FINANCIAL_PRECISION = 1.0E-8

Methods

payment()

IPMT.

public static payment(mixed $interestRate, mixed $period, mixed $numberOfPeriods, mixed $presentValue[, mixed $futureValue = 0 ][, mixed $type = FinancialConstants::PAYMENT_END_OF_PERIOD ]) : string|float

Returns the interest payment for a given period for an investment based on periodic, constant payments and a constant interest rate.

Excel Function: IPMT(rate,per,nper,pv[,fv][,type])

Parameters
$interestRate : mixed

Interest rate per period

$period : mixed

Period for which we want to find the interest

$numberOfPeriods : mixed

Number of periods

$presentValue : mixed

Present Value

$futureValue : mixed = 0

Future Value

$type : mixed = FinancialConstants::PAYMENT_END_OF_PERIOD

Payment type: 0 = at the end of each period, 1 = at the beginning of each period

Return values
string|float

rate()

RATE.

public static rate(mixed $numberOfPeriods, mixed $payment, mixed $presentValue[, mixed $futureValue = 0.0 ][, mixed $type = FinancialConstants::PAYMENT_END_OF_PERIOD ][, mixed $guess = 0.1 ]) : string|float

Returns the interest rate per period of an annuity. RATE is calculated by iteration and can have zero or more solutions. If the successive results of RATE do not converge to within 0.0000001 after 20 iterations, RATE returns the #NUM! error value.

Excel Function: RATE(nper,pmt,pv[,fv[,type[,guess]]])

Parameters
$numberOfPeriods : mixed

The total number of payment periods in an annuity

$payment : mixed

The payment made each period and cannot change over the life of the annuity. Typically, pmt includes principal and interest but no other fees or taxes.

$presentValue : mixed

The present value - the total amount that a series of future payments is worth now

$futureValue : mixed = 0.0

The future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (the future value of a loan, for example, is 0).

$type : mixed = FinancialConstants::PAYMENT_END_OF_PERIOD

A number 0 or 1 and indicates when payments are due: 0 or omitted At the end of the period. 1 At the beginning of the period.

$guess : mixed = 0.1

Your guess for what the rate will be. If you omit guess, it is assumed to be 10 percent.

Return values
string|float

schedulePayment()

ISPMT.

public static schedulePayment(mixed $interestRate, mixed $period, mixed $numberOfPeriods, mixed $principleRemaining) : string|float

Returns the interest payment for an investment based on an interest rate and a constant payment schedule.

Excel Function: =ISPMT(interest_rate, period, number_payments, pv)

Parameters
$interestRate : mixed

is the interest rate for the investment

$period : mixed

is the period to calculate the interest rate. It must be betweeen 1 and number_payments.

$numberOfPeriods : mixed

is the number of payments for the annuity

$principleRemaining : mixed

is the loan amount or present value of the payments

Return values
string|float

rateNextGuess()

private static rateNextGuess(float $rate, float $numberOfPeriods, float $payment, float $presentValue, float $futureValue, int $type) : string|float
Parameters
$rate : float
$numberOfPeriods : float
$payment : float
$presentValue : float
$futureValue : float
$type : int
Return values
string|float

        
On this page

Search results