richardschneider / money-works

Work with money in multiple currencies
MIT License
13 stars 5 forks source link

thousands separator is not working in Chile,Peru countries for amount < 10,000 #36

Open JeyaRajesh opened 4 years ago

JeyaRajesh commented 4 years ago

Hi Team, I am using "money-works": "^1.5.4" in my reactive native app for localisation.

It is woking fine in terminal and in Runkit editor.

The same code is not working in mobile app or any other browser.(tested in safari,mozilla and Chrome)

const price1 = new Money(9000, "CLP"); console.log("Money.. Chile..9000.price =", price1.toLocaleString("es-CL"));

Output in Terminal /Command window: Money.. Chile..9000.price = $9.000

output in Chrome debugger console or Iphone/Android. Money.. Chile..9000.price = $9000

Issue only with amount <10K.

Refer here for details : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat

Type the below code in the above URL editor box. console.log(new Intl.NumberFormat('es-CL', { style: 'currency', currency: 'CLP' }).format(3456)); // expected output: "$3.456"

you can see the issue.Looks like a browser compatibility issue.

Facing same issue for Chile,Peru,CostRica.

I need urgent help on this.

Thanks, Jeya

Screenshot 2020-06-17 at 9 40 55 PM Screenshot 2020-06-17 at 6 45 40 PM Screenshot 2020-06-17 at 5 31 21 PM
JeyaRajesh commented 4 years ago

Hi Team,

Is there any update on the above issue or can we modify the code and raise a pull request over here.