Discount Function: fixedAmount loses precision with multi-currency conversion

Summary

When using a Shopify discount function with fixedAmount, the discount amount loses precision when the presentment currency differs from the shop’s base currency. Shopify appears to convert the discount to base currency, round/floor it, then convert back — causing the applied discount to differ from the requested amount.

We started noticing this behavior around January 23, 2025.

This issue is related to my previous post about Inconsistent cents rounding on discounts across different stores, but affects a different scenario: multi-currency stores using fixedAmount discounts.

Expected Behavior

When I return a fixedAmount discount of 0.70 SEK, I expect Shopify to apply a 0.70 SEK discount.

Actual Behavior

Shopify applies 0.65 SEK instead of 0.70 SEK.

Evidence

Function input:

{
  "presentmentCurrencyRate": "10.769874",
  "cart": {
    "lines": [{
      "cost": { "subtotalAmount": { "amount": "128.7" } }
    }]
  }
}

Function output:

{
  "value": {
    "fixedAmount": {
      "amount": "0.7",
      "appliesToEachItem": false
    }
  }
}

Checkout result:

Expected Actual
Discount 0.70 SEK 0.65 SEK
Final price 128.00 SEK 128.05 SEK

Analysis

It appears Shopify is doing:

  1. Convert discount to base currency: 0.70 / 10.769874 = 0.065 EUR
  2. Round/floor to 2 decimals: 0.06 EUR
  3. Convert back: 0.06 × 10.769874 = 0.65 SEK

This causes precision loss, making it impossible to apply exact discount amounts in presentment currencies with high conversion rates.

Questions

  1. Is this the intended behavior for fixedAmount discounts?
  2. Should the amount field be specified in base currency or presentment currency?
  3. Is there a way to apply precise discount amounts in presentment currencies?
  4. Is this related to the changes that caused the inconsistent rounding behavior reported in my previous post?

Environment

  • Discount Function API version: 2024-10
  • Using productDiscountsAdd with fixedAmount
  • Base currency: EUR
  • Affected presentment currency: SEK (and likely others with high conversion rates)
1 Like

Hi @dostu, thanks for reaching out about this!

I have a few questions before I start digging into this:

  • Is this issue happening with normal discounts as well or just discounts based on Functions?
  • Are you seeing this across multiple shops or some?
  • What does the currency settings look like for the affected markets? e.g.
1 Like

Thanks for the quick reply!

  1. For normal discounts it’s only allowed to set up the discount in base currency, so it doesn’t affect them.

  1. Yes, this seems to be the default behaviour for all stores now.

  2. No rounding is set up on Market level.

Thanks for sharing!
I’ll look into whether there has been any changes on our end recently and get back to you.

3 Likes

I would be really grateful if you could nudge someone to look at @dostu’s original post: Inconsistent Cents Rounding on Discounts Across Different Stores - #2 by bkspace

It’s been 11 days with no communication.

3 Likes

@Paige-Shopify any updates on this please? :folded_hands:

Hi @dostu, apologies for the delay.
We needed to spend some time investigating this issue and are currently working on a fix. Your detailed report was incredibly helpful, thank you! I’ll provide an update here once the fix has been deployed.

1 Like

@Paige-Shopify just checking in. Do you have a timeline for the fix?

@dostu Not at this time, it’s still being worked on.

Hey all! I’m looking in to this and the fix here should be in place. Let us know if you’re still seeing this behaviour though.

2 Likes

Thanks team! Will keep an eye on any new complaints :crossed_fingers:

1 Like

@KyleG-Shopify we started to see another issue in the last few days with multicurrency, I wonder if it might be related to this fix?

1 Like

Thanks for linking that. I’m not sure if it’s related or not. I’ll check in with Paige and we will follow up on that thread with what we find.

1 Like

Hi @KyleG-Shopify is the fix still in place? We have started getting tickets about this precission issue again.

Hey @dostu, I can take a look. Is the issue identical to what you reported here initially, or has anything else changed? From what I can see the issue is resolved, so there may be something else happening here. Any new or additional context you can share will help!

Yes, the issue seems to be the same.

Example with MXN:

Total price is 8,430.00, I return 4,430.00 discount and the final price becomes 3,999.97. Invocation id: 318fa7b6-8019-4123-b607-bbbef41598fd

1 Like

We had to revert the fix for this because of the issue it caused with subscriptions that you flagged.

We’re working on a solution that doesn’t cause other issues, but we’re not able to provide an ETA for the fix yet. I’ll provide an update here once we have more information.

Thanks for catching these connected discounting issues, @dostu!

1 Like