• Post Reply Bookmark Topic Watch Topic
  • New Topic

System.out.printf with %f or %.6f give me comma  RSS feed

 
Andrzej Borucki
Ranch Hand
Posts: 90
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want decimal point. I changed regional settings in Control Panel to decimal point and not helps. How obtain decimal point?
(I have Polish Widows but regional settings I change)
------
Solution: in main(): Locale.setDefault(new Locale("en", "US"));
 
Campbell Ritchie
Marshal
Posts: 56529
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is normal; in most of non‑English‑speaking Europe, 12,345.67 is spelt 12.345,67. Setting the Locale to an English‑speaking place turns it back to 12,345.67. The thousands separators will probably appear in different places if you try an Indian Locale "en-IN"
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!