What locale is used (useful for e.g. printf in Java)?

Modified on Sun, 21 Feb, 2021 at 8:11 PM

The following lines:

System.out.println(Locale.getDefault());
System.out.println(String.format("%f", 1000 * Math.PI));
System.out.printf("%f\n", 1000 * Math.PI);


print:

en_US
3141.592654
3141.592654





Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article