2021-12-11 03:47:46 +00:00
|
|
|
const formatter = new Intl.NumberFormat('en-US', {
|
|
|
|
style: 'currency',
|
|
|
|
currency: 'USD',
|
|
|
|
maximumFractionDigits: 0,
|
2021-12-14 07:09:46 +00:00
|
|
|
minimumFractionDigits: 0,
|
2021-12-11 03:47:46 +00:00
|
|
|
})
|
|
|
|
|
2021-12-11 04:09:32 +00:00
|
|
|
export function formatMoney(amount: number) {
|
2021-12-11 03:47:46 +00:00
|
|
|
return 'M$ ' + formatter.format(amount).substr(1)
|
|
|
|
}
|
2021-12-11 04:09:32 +00:00
|
|
|
|
|
|
|
export function formatWithCommas(amount: number) {
|
|
|
|
return formatter.format(amount).substr(1)
|
|
|
|
}
|