I tried:
import locale
print(locale.locale_alias)
locale.setlocale(locale.LC_ALL, '')
locale.setlocale(locale.LC_NUMERIC, "french")
print(f"{3.14:.2f}")
but the output is 3.14
whereas I would like 3,14
.
How to do this with f"..." string formatting?
Note: I don't want to use .replace(".", ",")
Note: I'm looking for a Windows solution, and solutions from How to format a float with a comma as decimal separator in an f-string? don't work (thus it's not a duplicate on Windows):
locale.setlocale(locale.LC_ALL, 'nl_NL')
# or
locale.setlocale(locale.LC_ALL, 'fr_FR')
locale.Error: unsupported locale setting