Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 400 and 401] [Versions 400 and 402] [Versions 400 and 403]

(no description)

File Size: 199 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Periodic:: (6 methods):
  futureValue()
  presentValue()
  periods()
  calculateFutureValue()
  calculatePresentValue()
  calculatePeriods()


Class: Periodic  - X-Ref

futureValue($rate,$numberOfPeriods,$payment = 0.0,$presentValue = 0.0,$type = FinancialConstants::PAYMENT_END_OF_PERIOD)   X-Ref
FV.

Returns the Future Value of a cash flow with constant payments and interest rate (annuities).

Excel Function:
FV(rate,nper,pmt[,pv[,type]])

return: float|string
param: mixed $rate The interest rate per period
param: mixed $numberOfPeriods Total number of payment periods in an annuity as an integer
param: mixed $payment The payment made each period: it cannot change over the
param: mixed $presentValue present Value, or the lump-sum amount that a series of
param: mixed $type A number 0 or 1 and indicates when payments are due:

presentValue($rate,$numberOfPeriods,$payment = 0.0,$futureValue = 0.0,$type = FinancialConstants::PAYMENT_END_OF_PERIOD)   X-Ref
PV.

Returns the Present Value of a cash flow with constant payments and interest rate (annuities).

return: float|string Result, or a string containing an error
param: mixed $rate Interest rate per period
param: mixed $numberOfPeriods Number of periods as an integer
param: mixed $payment Periodic payment (annuity)
param: mixed $futureValue Future Value
param: mixed $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period

periods($rate,$payment,$presentValue,$futureValue = 0.0,$type = FinancialConstants::PAYMENT_END_OF_PERIOD)   X-Ref
NPER.

Returns the number of periods for a cash flow with constant periodic payments (annuities), and interest rate.

return: float|string Result, or a string containing an error
param: mixed $rate Interest rate per period
param: mixed $payment Periodic payment (annuity)
param: mixed $presentValue Present Value
param: mixed $futureValue Future Value
param: mixed $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period

calculateFutureValue(float $rate,int $numberOfPeriods,float $payment,float $presentValue,int $type)   X-Ref
No description

calculatePresentValue(float $rate,int $numberOfPeriods,float $payment,float $futureValue,int $type)   X-Ref
No description

calculatePeriods(float $rate,float $payment,float $presentValue,float $futureValue,int $type)   X-Ref

return: float|string