Child pages
  • [in-commerce] Order sub-total can be 0.01 off [5.2.2-B1]
Skip to end of metadata
Go to start of metadata

When calculating order sub-total, then non-rounded order item extended prices (qty * price) are summarized and then result is rounded, which will lead to wrong sub-total. This problem can't be reproduced on In-Commerce currently, because it has both sub-total and extended price with same precision (2 digits after comma). But one one of our projects we've changed extended price precision to 4 digits after comma and that created a problem.

Solution

The correct way according to accounting rules is to:

  • round all components individually
  • summarize rounded numbers
  • round final result

Related Tasks

1 Comment

  1. Was done in rRPI20267.