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
2023-06-27 14:01:32 +02:00

9 lines
305 B
TypeScript

export function formatCurrency(price: number | bigint, locale ='en-US', currency = 'CZK'): string {
const currencyFormatter = new Intl.NumberFormat(locale, {
style: 'currency',
currency: currency,
maximumFractionDigits: 0,
});
return currencyFormatter.format(price).replace(',', ' ')
}