how to print a Double without commas

后端 未结 10 726
萌比男神i
萌比男神i 2020-12-11 15:37

When using toString(), Double adds commas (5143 is printed as 5,143). How to disable the commas?

10条回答
  •  Happy的楠姐
    2020-12-11 16:22

    Probably, you have to change your locale settings. It is taken by default from system locale, but you can override this. Read javadoc on Locale class and this little tutorial to start. Locale can be specified through command line:

    java -Duser.language=en -Duser.region=US MyApplication
    

提交回复
热议问题