Skip to content

Commit f772e59

Browse files
merwokhugovk
authored andcommitted
use proper decimal separator for french
1 parent 7c341b9 commit f772e59

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/humanize/i18n.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
# Mapping of locale to decimal separator
3131
_DECIMAL_SEPARATOR = {
3232
"de_DE": ",",
33+
"fr_FR": ".",
3334
"it_IT": ",",
3435
"pt_BR": ",",
3536
"hu_HU": ",",

tests/test_i18n.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ def test_intcomma() -> None:
5555

5656
humanize.i18n.activate("fr_FR")
5757
assert humanize.intcomma(number) == "10 000 000"
58+
assert humanize.intcomma(1_234_567.89) == "1 234 567.89"
59+
assert humanize.intcomma("1 234 567.89") == "1 234 567.89"
5860

5961
humanize.i18n.activate("pt_BR")
6062
assert humanize.intcomma(number) == "10.000.000"

0 commit comments

Comments
 (0)