We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 2d493d7 + 90162a1 commit c91c8c9Copy full SHA for c91c8c9
src/PhpSpreadsheet/Calculation/Financial/Amortization.php
@@ -9,8 +9,6 @@
9
10
class Amortization
11
{
12
- private const ROUNDING_ADJUSTMENT = (PHP_VERSION_ID < 80400) ? 0 : 1e-14;
13
-
14
/**
15
* AMORDEGRC.
16
*
@@ -82,7 +80,7 @@ public static function AMORDEGRC(
82
80
$amortiseCoeff = self::getAmortizationCoefficient($rate);
83
81
84
$rate *= $amortiseCoeff;
85
- $rate += self::ROUNDING_ADJUSTMENT;
+ $rate = (float) (string) $rate; // ugly way to avoid rounding problem
86
$fNRate = round($yearFrac * $rate * $cost, 0);
87
$cost -= $fNRate;
88
$fRest = $cost - $salvage;
0 commit comments