- 🇪🇸Spain plopesc Valladolid
We are experiencing a similar issue, and the reason why we have prices with more than 2 decimals is that Commerce price widget allows to enter them. Product manager entered a 3 decimals price by accident.
Adjustments are more likely to have more than 2 decimals, but they are not throwing this error. Reason is that adjustments are rounded by the following call:
$adjustments = $this->adjustmentTransformer->processAdjustments($adjustments);
That internally combines, sort and round the adjustments.So, it seems logic that unit item prices are rounded as well, as proposed in the patch.
Would be great if you could consider this patch, or propose a different approach.
Thank you!
- Status changed to Needs work
4 months ago 6:56am 12 July 2024 - 🇮🇱Israel jsacksick
Usually the total is rounded, not the unit price, but if not rounding is causing issues in some cases, willing to commit the patch.
However, the patch doesn't use dependency injection, so it's not acceptable as is. - Merge request !25Issue #3283973: Order items unit_amount is not rounded properly → (Merged) created by plopesc
- Status changed to Needs review
4 months ago 6:47am 15 July 2024 - 132b1805 committed on 8.x-1.x
Issue #3283973: Order items unit_amount is not rounded properly
- 132b1805 committed on 8.x-1.x
- Status changed to Fixed
4 months ago 8:09am 15 July 2024 Automatically closed - issue fixed for 2 weeks with no activity.