Open nikcani opened 2 years ago
@nikcani I add one PR #126. Dealing with float is not easy in PHP. There's remain some issues.
cc @Flynamic
Dealing with float is not easy in PHP.
sure, thx for trying
It's not just a try. It's an improvement and I found others issues with float. But it works better with my fix.
I test firstly if I didn't add any regression. And I can assure you there is no regression
Thanks for improving :)
If you try to validate if the number 400.01 is a multiple of 0.01, you get an error that is not expected.
I have bcmath installed and thus Helper::isMultipleOf is going that way in my setup. Logging shows me that 400.01 is internally handled as 400.00999999999999 and 0.01 is 0.01000000000000, therefore the comparison is between 0 and 0.00999999999999.
I am unsure how to fix this, otherwise, I would have opened a pull request.
Thx upfront for any help :)