Why Java double print format is different based on String.format use or not
4 answers
The first uses the default locale .
second is probably using a standard (non-localizable) implementation.
0
a source to share
String.format () uses the locale of your system. There should also be a variant of this method, you can pass a specific instance of Locale. When using println () on the other hand, the toString () method is called - in your case Double # toString (), which is more often than not a fairly basic implementation, good enough to represent a clear display of the object.
0
a source to share