-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
computers suck at math #50
Comments
Casting to integer will result into cut of the number and not into a rounded numbers. Normally by casting to integer: |
I'm have rounding issues too. |
Use https://github.com/php-sepa-xml/php-sepa-xml instead. As far as I know we fixed all rounding issues there. It's a fork of this repository which is actively maintained. |
hi,
You may have rounding errors in the constructor of BaseTransferInformation :
$amount = (integer) ($amount * 100); //may cause rounding errors
should be replaced with:
$amount = (integer) (round($amount * 100, 0));
see why computers suck at math :
http://www.techradar.com/news/computing/why-computers-suck-at-maths-644771/1
thanks for your work :)
The text was updated successfully, but these errors were encountered: