It turns out that `Double.toString()` uses some de...
# android
n
It turns out that
Double.toString()
uses some default (?) locale , while
String.format("%.1f")
uses the locale selected by the user. So, I end up with two different decimal separators in the same message (both ‘,’ and ‘.’) Is this expected behavior?
m
toString()
returns a machine-readable string which can be parsed again using
toDouble()
formatting is more for human-readable strings (but I guess can also be used for machine-readable output by using the right locale)
👍 1
n
So,
toString()
uses the
en-US
locale in all cases, apparently. (though a quick google search does not result into links to official docs)
m