1
0
Fork 0
This repository has been archived on 2025-08-23. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
mareshq-backoffice-v1-monolith/lib/currency/formatter.ts
Vojtech Mares 623b018a1b
feat: add /trainings page
- list of trainings
- add button (taken from github: vojtechmares/website)
- add currency formatter
2023-06-25 17:06:17 +02:00

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(',', ' ')
}