Last active
August 12, 2024 18:29
-
-
Save axel-rock/1556efb7ddf9cbb4fa4cc9b91d9ccfe1 to your computer and use it in GitHub Desktop.
Format a price from Stripe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// How to make sure to display the price from Stripe correctly using Intl.NumberFormat | |
new Intl.NumberFormat(undefined, { | |
style: 'currency', | |
currency: price.currency, | |
}).format((price.unit_amount as number) / 100) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment