Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Differences Between: [Versions 400 and 403]

(no description)

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

Defines 1 class

Single:: (3 methods):
  futureValue()
  periods()
  interestRate()


Class: Single  - X-Ref

futureValue($principal, $schedule)   X-Ref
FVSCHEDULE.

Returns the future value of an initial principal after applying a series of compound interest rates.
Use FVSCHEDULE to calculate the future value of an investment with a variable or adjustable rate.

Excel Function:
FVSCHEDULE(principal,schedule)

param: mixed $principal the present value
param: float[] $schedule an array of interest rates to apply
return: float|string

periods($rate, $presentValue, $futureValue)   X-Ref
PDURATION.

Calculates the number of periods required for an investment to reach a specified value.

param: mixed $rate Interest rate per period
param: mixed $presentValue Present Value
param: mixed $futureValue Future Value
return: float|string Result, or a string containing an error

interestRate($periods = 0.0, $presentValue = 0.0, $futureValue = 0.0)   X-Ref
RRI.

Calculates the interest rate required for an investment to grow to a specified future value .

param: float $periods The number of periods over which the investment is made
param: float $presentValue Present Value
param: float $futureValue Future Value
return: float|string Result, or a string containing an error