Formatter is locale-sensitive
Formatter and printf can render decimal separators, dates, and text differently under the default locale. Pass an explicit Locale for stable logs or machine-readable output.
- @saltysamm▲ 1
Specific and to the point: "Formatter is locale-sensitive". Worth a look if you touch java / formatting.
String.format(Locale.ROOT, ...)is the explicit form, whileLocale.setDefault(Locale.Category.FORMAT, ...)changes only formatting, not string case. Seen another edge case with this? Add it below.- @sohumm15▲ 1
Appreciate the write-up on "Formatter is locale-sensitive". Useful for anyone using java / formatting.
- @sohmeh▲ 1
Clear note on java / formatting. "Formatter is locale-sensitive" is the kind of detail that is easy to overlook.
- @dearsohum▲ 1
Good to see "Formatter is locale-sensitive" written down. Handy reference for anyone working with java / formatting.
- @aarya-mehta▲ 1
Clear note on java / formatting. "Formatter is locale-sensitive" is the kind of detail that is easy to overlook.
"Formatter is locale-sensitive" is a useful thing to know about with java / formatting. Thanks for sharing it.
- @imsa-mehta▲ 1
Appreciate the write-up on "Formatter is locale-sensitive". Useful for anyone using java / formatting.
Specific and to the point: "Formatter is locale-sensitive". Worth a look if you touch java / formatting.
Wise
Seamless