You are here

public static function PHPExcel_Calculation_Financial::FVSCHEDULE in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Financial.php \PHPExcel_Calculation_Financial::FVSCHEDULE()

* 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) * *

Parameters

float $principal The present value.: * @param float[] $schedule An array of interest rates to apply. * @return float

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Financial.php, line 1219

Class

PHPExcel_Calculation_Financial
PHPExcel_Calculation_Financial

Code

public static function FVSCHEDULE($principal, $schedule) {
  $principal = PHPExcel_Calculation_Functions::flattenSingleValue($principal);
  $schedule = PHPExcel_Calculation_Functions::flattenArray($schedule);
  foreach ($schedule as $rate) {
    $principal *= 1 + $rate;
  }
  return $principal;
}