11 lines
274 B
JavaScript
11 lines
274 B
JavaScript
const getNumberWithCurrency = (value, currency = 'EUR') => {
|
|
const formatter = Intl.NumberFormat('it-IT', {
|
|
style: 'currency',
|
|
currencyDisplay: 'symbol',
|
|
currency
|
|
})
|
|
|
|
return formatter.format(value)
|
|
}
|
|
|
|
export default getNumberWithCurrency; |