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.
The correct way according to accounting rules is to:
- round all components individually
- summarize rounded numbers
- round final result