It seems that the Argentine Peso (ARS) notation for currency is complete the opposite from what the Dollar is in the US. The ,
is used as a decimal separator, and the .
is used as a thousands separator.
1121
=> $1.121,00
1000.5
=> $1.000,50
85.72
=> $85,72
I've looked into numeral
(npm numeral js
) and I have not been able to convert a float to the currency format specified above.
Here's what I tried:
> numeral('87.75').format('$0.0,00')
'$87.7500'
> numeral('87.75').format('$0,0.00')
'$87.75'
> numeral('87.75').format('$0,00')
'$88'
> numeral('87.75').format('$0.00')
'$87.75'
> numeral('87.75').format('$00,00')
'$88'
> numeral('87.75').format('$0.00')
'$87.75'
> numeral('87.75').format('$00,00')
'$88'
> numeral('87.75').format('$00,00.00')
'$87.75'
> numeral('87.75').format('$0[.]0.00')
'$87.8'
> numeral('87.75').format('$0[.]0[.]00')
'$87.8'
> numeral('87.75').format('$0[.]0[,]00')
'$87.75'
> numeral('87.75').format('$0[,]0[,]00')
'$88'
These are all strings but that shouldn't effect the formatting.
You have to create your own format. Scroll down the numeral.js documentation to 'Languages' section for an example on how to define delimiters.
numeral.language('es_ar', {
delimiters: {
thousands: '.',
decimal: ','
},
currency: {
symbol: '$'
}
});
numeral.language('es_ar');
numeral(1087.76).format('$0,0.00')
> "$1.087,76"