public static function PHPExcel_Calculation_Financial::IPMT in Loft Data Grids 7.2
Same name and namespace in other branches
- 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Financial.php \PHPExcel_Calculation_Financial::IPMT()
* IPMT * * 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
float $rate Interest rate per period: * @param int $per Period for which we want to find the interest * @param int $nper Number of periods * @param float $pv Present Value * @param float $fv Future Value * @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period * @return float
1 call to PHPExcel_Calculation_Financial::IPMT()
- PHPExcel_Calculation_Financial::CUMIPMT in vendor/
phpoffice/ phpexcel/ Classes/ PHPExcel/ Calculation/ Financial.php - * CUMIPMT * * Returns the cumulative interest paid on a loan between the start and end periods. * * Excel Function: * CUMIPMT(rate,nper,pv,start,end[,type]) * * @access public * @category Financial Functions *
File
- vendor/
phpoffice/ phpexcel/ Classes/ PHPExcel/ Calculation/ Financial.php, line 1296
Class
- PHPExcel_Calculation_Financial
- PHPExcel_Calculation_Financial
Code
public static function IPMT($rate, $per, $nper, $pv, $fv = 0, $type = 0) {
$rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate);
$per = (int) PHPExcel_Calculation_Functions::flattenSingleValue($per);
$nper = (int) PHPExcel_Calculation_Functions::flattenSingleValue($nper);
$pv = PHPExcel_Calculation_Functions::flattenSingleValue($pv);
$fv = PHPExcel_Calculation_Functions::flattenSingleValue($fv);
$type = (int) PHPExcel_Calculation_Functions::flattenSingleValue($type);
// Validate parameters
if ($type != 0 && $type != 1) {
return PHPExcel_Calculation_Functions::NaN();
}
if ($per <= 0 || $per > $nper) {
return PHPExcel_Calculation_Functions::VALUE();
}
// Calculate
$interestAndPrincipal = self::_interestAndPrincipal($rate, $per, $nper, $pv, $fv, $type);
return $interestAndPrincipal[0];
}