mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-12 19:16:45 +00:00
Merge pull request #4107 from oleibman/pr848
RATE Function Permits Floating Point NPER
This commit is contained in:
@@ -165,7 +165,7 @@ class Interest
|
||||
$guess = ($guess === null) ? 0.1 : Functions::flattenSingleValue($guess);
|
||||
|
||||
try {
|
||||
$numberOfPeriods = CashFlowValidations::validateInt($numberOfPeriods);
|
||||
$numberOfPeriods = CashFlowValidations::validateFloat($numberOfPeriods);
|
||||
$payment = CashFlowValidations::validateFloat($payment);
|
||||
$presentValue = CashFlowValidations::validatePresentValue($presentValue);
|
||||
$futureValue = CashFlowValidations::validateFutureValue($futureValue);
|
||||
@@ -193,7 +193,7 @@ class Interest
|
||||
return $close ? $rate : ExcelError::NAN();
|
||||
}
|
||||
|
||||
private static function rateNextGuess(float $rate, int $numberOfPeriods, float $payment, float $presentValue, float $futureValue, int $type): string|float
|
||||
private static function rateNextGuess(float $rate, float $numberOfPeriods, float $payment, float $presentValue, float $futureValue, int $type): string|float
|
||||
{
|
||||
if ($rate == 0.0) {
|
||||
return ExcelError::NAN();
|
||||
|
||||
@@ -29,6 +29,18 @@ return [
|
||||
-250,
|
||||
5000,
|
||||
],
|
||||
[
|
||||
0.017929869399484,
|
||||
24.99,
|
||||
-250,
|
||||
5000,
|
||||
],
|
||||
[
|
||||
0.016581855,
|
||||
24.5,
|
||||
-250,
|
||||
5000,
|
||||
],
|
||||
[
|
||||
0.016550119066711999,
|
||||
24,
|
||||
|
||||
Reference in New Issue
Block a user