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

Price not respect set locale #433

Open
schrek1 opened this issue Sep 11, 2019 · 4 comments · May be fixed by #516
Open

Price not respect set locale #433

schrek1 opened this issue Sep 11, 2019 · 4 comments · May be fixed by #516

Comments

@schrek1
Copy link

schrek1 commented Sep 11, 2019

I set explicitly locale in the constructor
Faker f = new Faker(Locale.ENGLISH);
but if I call f.commerce().price() it returns number in computer locale format.

I think it is becouse in price is called new DecimalFormat("#0.00").format(price); and inside it is called Locale.getDefault instead should use preset locale in faker constructor e.g. DecimalFormat("#0.00", new DecimalFormatSymbols(userLocale))

@clarenced
Copy link

clarenced commented Apr 6, 2020

Hi same problem here, great correction. Did you propose a Pull request for this issue ? @schrek1

@irakatz irakatz linked a pull request May 8, 2020 that will close this issue
@IliasPapanikolaou
Copy link

Same here, please correct this, the fix to this issue has posted by @schrek1

@AlexZhuk
Copy link

Have the same issue as well, as work around i'm using

Locale.setDefault(Locale.US);

on initing my project

@bodiam
Copy link

bodiam commented Oct 30, 2022

This is probably fixed in Datafaker.net, could you give that a shot?

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.

5 participants