Strategies for formatting/localizing currency amounts in Cart and Checkout Validation error messages?

The tutorial simply harcodes a $ in its error message, but that of course won’t work for merchants selling in multiple markets, or those using a non-dollar default currency.

The function provides access to the cart’s currency code, but we’d like to present the customer with a properly formatted currency amount, including correct currency symbol, separators, and decimal precision.

How are folks going about achieving this, currently? Rolling your own version of Intl.NumberFormat inside your function logic? Also curious what Shopifolk recommend here.

Thanks for flagging this Jason - I’m investigating what would be the best approach for this.

1 Like

Thanks for digging in @Liam-Shopify! Made any discoveries yet? :slight_smile:

Hi again - It’s on the checkouts team to update this tutorial, but I’ve no ETA to share on this right now.

Thanks for the update @Liam-Shopify :man_bowing: