@@ 1203-1214 (lines=12) @@ | ||
1200 | * |
|
1201 | * @return float |
|
1202 | */ |
|
1203 | public static function EFFECT($nominal_rate = 0, $npery = 0) |
|
1204 | { |
|
1205 | $nominal_rate = Functions::flattenSingleValue($nominal_rate); |
|
1206 | $npery = (int) Functions::flattenSingleValue($npery); |
|
1207 | ||
1208 | // Validate parameters |
|
1209 | if ($nominal_rate <= 0 || $npery < 1) { |
|
1210 | return Functions::NAN(); |
|
1211 | } |
|
1212 | ||
1213 | return pow((1 + $nominal_rate / $npery), $npery) - 1; |
|
1214 | } |
|
1215 | ||
1216 | /** |
|
1217 | * FV. |
|
@@ 1549-1561 (lines=13) @@ | ||
1546 | * |
|
1547 | * @return float |
|
1548 | */ |
|
1549 | public static function NOMINAL($effect_rate = 0, $npery = 0) |
|
1550 | { |
|
1551 | $effect_rate = Functions::flattenSingleValue($effect_rate); |
|
1552 | $npery = (int) Functions::flattenSingleValue($npery); |
|
1553 | ||
1554 | // Validate parameters |
|
1555 | if ($effect_rate <= 0 || $npery < 1) { |
|
1556 | return Functions::NAN(); |
|
1557 | } |
|
1558 | ||
1559 | // Calculate |
|
1560 | return $npery * (pow($effect_rate + 1, 1 / $npery) - 1); |
|
1561 | } |
|
1562 | ||
1563 | /** |
|
1564 | * NPER. |