forked from crowetic/commerce
17 lines
296 B
TypeScript
17 lines
296 B
TypeScript
|
export default function formatPrice({
|
||
|
amount,
|
||
|
currencyCode,
|
||
|
locale,
|
||
|
}: {
|
||
|
amount: number
|
||
|
currencyCode: string
|
||
|
locale: string
|
||
|
}) {
|
||
|
const formatCurrency = new Intl.NumberFormat(locale, {
|
||
|
style: 'currency',
|
||
|
currency: currencyCode,
|
||
|
})
|
||
|
|
||
|
return formatCurrency.format(amount)
|
||
|
}
|