0

There seems to be a very odd rounding error on promotions; this order has a 20% discount applied on two lines - both tax-exempt food items:

Magento price quirk

  • Line 1: (1 * ((13.99 / 100) * 20)) = 2.798 which rounds to 2.8
  • Line 3: (2 * ((8.49 / 100) * 20)) = 3.396 should round to 3.4 not 3.39

Why is 2.798 getting rounded up yet 3.396 getting rounded down?

I'm sure it has something to do with the Qty - like a rounding error doubled - but I can't find where that calculation is actually done in the code...

5
  • Are you using any 3rd-party promotion extensions? Commented Feb 5, 2018 at 17:00
  • Maybe this is worth to read: magento.stackexchange.com/questions/108570/…. I would like to reproduce this ... can you please share your store setting? Are prices stored incl/ecxl. VAT. VAT rate, etc?
    – sv3n
    Commented Feb 5, 2018 at 22:59
  • @RickyOdinMatthews - this site was developed by an agency ... there are soooooo many 3rd party extensions - but I think the only one to do with promotions is one that allows you to bulk create coupon codes. However, I've compared it to an M1 site developed in-house where we've had full control and yeah, it seems to behave differently. I'll do some more digging.
    – CD001
    Commented Feb 6, 2018 at 10:20
  • @CD001I've had rounding issues with Amasty Special Promotions Pro, the rounding issue was caused when upgrading to PHP7 due to different rounding methods, if that info is of any use to you. Good luck Commented Feb 6, 2018 at 11:30
  • 1
    @RickyOdinMatthews - aaaah, you may have just hit the nail on the head, that's the Amasty_Xcoupon module isn't it ... and we're running PHP7 :)
    – CD001
    Commented Feb 6, 2018 at 12:24

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.