We’ve recently started receiving complaints from our users regarding inconsistent cents rounding when applying discounts to multiple items using Shopify discount functions. The issue appears to affect only SOME stores, not all, which makes it particularly puzzling.
Problem Description:
We’re using discount functions to apply percentage-based discounts, and the final price shows different rounding behavior across different stores. This inconsistency makes it impossible for us to show the correct price in our widget because we can’t predict which rounding behavior a particular store will use.
Example:
Item price: $46.99
Quantity: 2
Discount: 10% off when buying 2 (via discount function)
Expected calculation:
Subtotal: $46.99 × 2 = $93.98
10% discount: $93.98 × 0.10 = $9.398
Final price after discount: $93.98 - $9.398 = $84.582
Actual behavior:
Some stores show: €84.59 (this was the previous consistent behavior)
Other stores show: €84.60 (this is the new behavior)
Key observations:
This started happening recently - we haven’t made any changes to our discount function code
Previously, ALL stores consistently showed €84.59
Now some stores are showing €84.60 instead
The behavior differs between stores, even with identical discount function implementations
Questions:
Has there been any recent changes to Shopify’s discount function rounding logic?
Is anyone else noticing this inconsistent behavior?
Any insights or guidance would be greatly appreciated. This is causing customer confusion and inconsistency across our stores.
We’ve had a couple of support requests about this also - but haven’t narrowed anything down too much.
@dostu - is there a difference in how the discount’s are allocated if you do ‘one discount with multiple targets’, or ‘Many discounts, each with one target’. e.g
I’ll be digging into this one as well while I’m investigating the rounding issue with fixed amount discounts. It’s quite possible the two issues are related.
For this one I noticed you said that it only occurs on some stores @dostu? Has that changed at all?
I’ve confirmed the updated cent-rounding behavior for percentage discounts is now rolled out across all stores, so you shouldn’t see differences from one store to another.
Previously, percentage discounts were calculated against the total line quantity. Now they’re calculated per unit.
To illustrate using the example shared:
Item price: $46.99
Quantity: 2
Discount: 10% off when buying 2 (via discount function)