I had a problem with a price being rounded incorrectly. The webshop I have should have prices ending on 0 or 5 (so 1.00, 1.05, 1.10, etc).
The tax rate is 19%, so if I have a price without taxes of 37.605, than to me the price including taxes is:
37.605 * 1.19 = 44.74995 => 44.75
However zen-cart 1.3.8 comes with 44.74 because it does some strange rounding. To zen-car the price including taxes is:
zen_round(37.605,2) + zen_round(37.605 * 0.19,2) =
36.6 + 7.14 = 44.74
The I do not understand when 37.605 is rounded to 37.6. The numbert of decimals (scale) is set to 2, so it should have rounded to 37.61.
If I execute "round(37.605,2)" directly, I still get 37.6... This is wierd, PHP per default does "round half up".
Bookmarks