1

If I open the 'Region and language' dialog, I have 'Formats' set to 'Germany'. If I click that setting, the 'Numbers' preview is '123.456.789,00' (comma as a decimal separator).

But if I run python3 -c 'import locale; print(locale.localeconv()["decimal_point"])', it outputs . (a dot, not a comma).

How can I get the decimal point as configured by the user in the 'Region and language' dialog?

wjandrea
  • 14,504

1 Answers1

1

You need to run locale.setlocale() too.

python3 -c 'import locale; locale.setlocale(locale.LC_ALL, ""); print(locale.localeconv()["decimal_point"])'