{"section":"known-issues","requestedLocale":"en","requestedSlug":"promotions-microrounding-divergence","locale":"en","slug":"promotions-microrounding-divergence","path":"docs/en/known-issues/Catalog/promotions-microrounding-divergence.md","branch":"main","content":"## Summary\n\n\nThe promotions module rounds discounts in up to 3 significative digits, which can, in very specific scenarios, amount to slight divergences in the final price of a cart.\n\nFor instance, let's say we have the following, example scenario:\n\nItem 1 - $10\nItem 2 - $20\nItem 3 - $32\n____________\nTotal - $62\n\nAnd 2 promotions applying in all of them:\n\nPromotion A - $15 OFF\nPromotion B - 10% OFF.\n\n\nUsually, the discount to be calculated is sequential, with the nominal value off coming first:\n\n$62 - $15 = $47\nThen\n$47 * 0.9 = $42.3\n\n\nHowever, the discounts are distributed, even for the nominal discount, proportionally in the cart, so what really happens is:\n\n`item 1`:\nOriginal value = $10\nNominal discount (15 * 10/62 of the cart) = -$2.41935484\nPercentual expected discount (12.5806452 * 0.9) = -$1.25806452\nPercentual real discount = -$1.258\n\n`item 2`:\nOriginal value = $20\nNominal discount (15 * 20/62 of the cart) = -$4.83870968\nPercentual expected discount (15.1612903 * 0.9) = -$1.51612903\nPercentual real discount = -$1.516\n\n`item 3`:\nOriginal value = $32\nNominal discount (15 * 32/62 of the cart) = -$7.74193548\nPercentual expected discount (24.2580645 * 0.9) = -$2.42580645\nPercentual real discount = -$2.426\n\n\n🔎 total diference: 0.00006452 + 0.000012903 + 0.000019355 = 0.0000270973\n\nWe can see, above, that a \"micro\" difference was created.\n\nIf, several items were added, with distinct prices, to this example cart, this difference could amount to 1 cent (0.01) or more.\n\n\n\n##\n\n## Simulation\n\n\nThere are a multitude of ways to eventually recreate the case Fortunately, all of them are extremely specific.\n\nGiven that, it's hard to replicate the issue, but, mostly, it's necesary to create a cart with several (~10+) different items and all of them with 2+ promotions, ideally, one of them being a nominal discount and the other one, a percentual discount.\n\n\n\n##\n\n## Workaround\n\n\nn/a"}