Skip to content

Commit

Permalink
fix: format price on billing currency
Browse files Browse the repository at this point in the history
  • Loading branch information
kweripx committed Jan 9, 2024
1 parent ef8189c commit e0c7b4a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/lib/billing/formatPrice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ export const formatPrice = (
maxFractionDigits: 0,
}
) => {
const isEuropean = guessIfUserIsEuropean()
const formatter = new Intl.NumberFormat(isEuropean ? 'fr-FR' : 'en-US', {
const formatter = new Intl.NumberFormat('pt-BR', {
style: 'currency',
currency: currency?.toUpperCase() ?? (isEuropean ? 'EUR' : 'USD'),
currency: currency?.toUpperCase(),
maximumFractionDigits: maxFractionDigits,
})
return formatter.format(price)
Expand Down

1 comment on commit e0c7b4a

@vercel
Copy link

@vercel vercel bot commented on e0c7b4a Jan 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.