Inconsistent Cents Rounding on Discounts Across Different Stores

Hi there,

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.

9 Likes

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

discounts: [{
  value: 10,
  targets: [1, 2, 3]
}]

-----------------------------

discounts: [{
  value: 10,
  targets: [1]
}, {
  value: 10,
  targets: [2]
}, {
  value: 10,
  targets: [3]
}]

Just to bump this up. We’re getting notifications of this from more and more stores now.

I believe another breaking change was introduced at the same time too: Discount Function: fixedAmount loses precision with multi-currency conversion

2 Likes

The oldest user complaint I could find is January 13 but it could have started happening before.

Hi @dostu and @bkspace,

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 believe this one is already rolled out on all stores. We’ve adapted our widget to the new rules, so we show the same amount in the product page too.

Although it’s not clear for our users why 6 * $10.99 with 50% discount results in $33.00 instead of $32.97 now.

The problem is it fundamentally changes how a % discount is spread across targets - so I’m unsure of the full impact.

Thanks you both for sharing this context.

I’m still checking internally on this.

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)

New expected behavior:

  • Discount : 46.99 x 0.1 = 4.699 = 4.69 (rounded down)
  • Unit price after discount : 46.99 - 4.69 = 42.30
  • Subtotal : 42.30 x 2 = 84.60

Previous behavior:

  • Subtotal before discount: 46.99 × 2 = 93.98
  • Discount : 93.98 x 0.1 = 9.398
  • Price after discount : 93.98 - 9.398 = 84.582
  • Subtotal : 84.59 (rounded up)

Let me know if you have any questions about this change.

2 Likes

Thank you for confirming it’s the new expected behaviour and fully rolled out :folded_hands:

1 Like