Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong currency #23

Open
wendt88 opened this issue Jul 10, 2020 · 5 comments · May be fixed by #24
Open

wrong currency #23

wendt88 opened this issue Jul 10, 2020 · 5 comments · May be fixed by #24

Comments

@wendt88
Copy link

wendt88 commented Jul 10, 2020

new Intl.NumberFormat('en-US', {
    style: 'currency',
    currency: 'EUR'
}).format(1);

returns: $ 1.00 it seems that the currency option gets ignored... it takes always the currency from the locale's location

@StefanNedelchev
Copy link

StefanNedelchev commented Jul 15, 2020

I second that. I have the same issue. The weird thing is that for some reason the locale affects the currency (which isn't supposed to be like that). My example:

(new Intl.NumberFormat('bg-BG', { style: 'currency', currency: 'BGN' })).format(1)
// returns "1.00 лв." which is correct
(new Intl.NumberFormat('en-US', { style: 'currency', currency: 'BGN' })).format(1)
// returns "$1.00" which is incorrect - it should return "BGN 1.00"

In both cases the currency is the same (BGN) but the printed currency symbol is different.

Here, I've made a JSFiddle example so you can see the results from the same example but in vanilla JS environment

@StefanNedelchev
Copy link

UPDATE: I tested this on iOS and it seems to work correctly which means that the issue is probably specific to Android.

@t1sh0o t1sh0o linked a pull request Jul 21, 2020 that will close this issue
@StefanNedelchev
Copy link

This pull request seems to fix the issue for me

@wendt88
Copy link
Author

wendt88 commented Mar 8, 2021

more than 6 months are passed and no one was able to merge this awesome bug fixing PR 🙈

@StefanNedelchev
Copy link

more than 6 months are passed and no one was able to merge this awesome bug fixing PR 🙈

I still use a local version with that fix because of that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants