You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can round it to the desired precision beforehand (maybe only directly before calling floor or ceil). But it depends on what the code actually wants to have as a result in certain edge cases...
Isotope 2.9.6, C4.13, PHP 8.1 and also PHP 8.3
A discount with a negative percentage value will randomly lead to incorrect calculations (see screenshots. 139: wrong, 159 ok)
The case here is a product price of 139.00 and a discount of -10% as rule for each Product and normal rounding.

After testing and discussion it seems to be a floating point error for ceil at
core/system/modules/isotope_rules/library/Isotope/Model/ProductCollectionSurcharge/Rule.php
Line 205 in 14c204b
As @fritzmg said the error can be reproduced using
More test results:
dd at line 205:
The text was updated successfully, but these errors were encountered: