We use metafields of type money to display discounts on the storefront. This approach works well because the discount is automatically converted to the presentment currency.
However, the converted value is rounded according to the currency’s rounding rules. This creates an issue since our Shopify Function subtracts the discount from the total price, and the rounding on the storefront results in a mismatch.
Is there a way to display the unrounded, converted value of a money-type metafield in the presentment currency using Liquid?
For example:
Original Discount: 100 USD
Expected Converted Discount without Rounding: 95.65 EUR (based on current exchange rates)
Just trying to understand this issue a bit more - at what point exactly is the rounding happening? Are you looking to disable just the rounding when the metafield is being displayed but keep the rounding on the stores’ currently rules?
The rounding occurs when we render a money metafield in our app block using the code similar to this: {{ product.metafields.custom.discount.value | money }}.
What I’m looking to do is disable the rounding in this specific case while still keeping the conversion to the presentment currency. Since we store a fixed amount discount in this metafield, we just need to display it “as is” without any rounding applied.