Improve rounding strategy in promotion engine

Fixed in

EPiServer.Commerce 12.4.0

Created

Jun 14, 2018

Updated

Oct 28, 2020

Area

Core

State

Closed, Acceptance tests pass


Description

The promotion engine's old rounding strategy is to always round to the maximum precision allowed by the current currency, adjusting for rounding issues by sprinkling money across affected line items.

This may cause "off by a cent" errors in a couple of edge-cases.

The new rounding strategy performs all promotion calculations with full precision and does rounding (and possibly sprinkles money to adjust for errors) only once, at the end of promotion calculations.