mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-17 05:26:45 +00:00
@@ -9,8 +9,6 @@ use PhpOffice\PhpSpreadsheet\Calculation\Functions;
|
||||
|
||||
class Amortization
|
||||
{
|
||||
private const ROUNDING_ADJUSTMENT = (PHP_VERSION_ID < 80400) ? 0 : 1e-14;
|
||||
|
||||
/**
|
||||
* AMORDEGRC.
|
||||
*
|
||||
@@ -82,7 +80,7 @@ class Amortization
|
||||
$amortiseCoeff = self::getAmortizationCoefficient($rate);
|
||||
|
||||
$rate *= $amortiseCoeff;
|
||||
$rate += self::ROUNDING_ADJUSTMENT;
|
||||
$rate = (float) (string) $rate; // ugly way to avoid rounding problem
|
||||
$fNRate = round($yearFrac * $rate * $cost, 0);
|
||||
$cost -= $fNRate;
|
||||
$fRest = $cost - $salvage;
|
||||
|
||||
Reference in New Issue
Block a user