- list of trainings - add button (taken from github: vojtechmares/website) - add currency formatter
9 lines
322 B
TypeScript
9 lines
322 B
TypeScript
export function formatCurrency(price: number | bigint, locale: string = 'en-US', currency: string = 'CZK'): string {
|
|
const currencyFormatter = new Intl.NumberFormat(locale, {
|
|
style: 'currency',
|
|
currency: currency,
|
|
maximumFractionDigits: 0,
|
|
});
|
|
|
|
return currencyFormatter.format(price).replace(',', ' ')
|
|
}
|