我想用Intl 的 NumberFormat格式化货币,并在符号和数字之间用空格“”获取返回值。
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"
我想要什么:“US$ 12.345,00”、“R$ 12.345,00”
有任何想法吗?