I want to format a currency with NumberFormat of Intl and get the returned value with a space " " between the symbol and the number.
new Intl.NumberFormat('pt-br', { style: 'currency', currency: 'USD' }).format(12345)
// "US$12.345,00"
new Intl.NumberFormat('pt-br', { style: 'currency', currency: 'BRL' }).format(12345)
// "R$12.345,00"
What I want: "US$ 12.345,00", "R$ 12.345,00"
Any ideas?
'$'
as second argument in String#replace has special meaning. – Mishamishaan