sepa-sdd-xml-generator icon indicating copy to clipboard operation
sepa-sdd-xml-generator copied to clipboard

controlSum floating point precision error

Open Daddaaff opened this issue 7 years ago • 3 comments

public function addTransaction(SEPADirectDebitTransaction $transaction) { $this->transactions[] = $transaction; $this->numberOfTransactions++; $this->controlSum += $transaction->getInstructedAmount(); }

The addition of the controlSum can generate floating point precision errors, resulting in controlsums like 9471.4899999999.

Daddaaff avatar Dec 04 '16 13:12 Daddaaff