Skip to content

Commit

Permalink
Internationalise intcomma for de_DE locale
Browse files Browse the repository at this point in the history
  • Loading branch information
Luflosi committed Aug 24, 2022
1 parent 14fc392 commit b206342
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/humanize/i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

# Mapping of locale to thousands separator
_THOUSANDS_SEPARATOR = {
"de_DE": ".",
"fr_FR": " ",
}

Expand Down
2 changes: 2 additions & 0 deletions tests/test_i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ def test_intcomma() -> None:
assert humanize.intcomma(number) == "10,000,000"

try:
humanize.i18n.activate("de_DE")
assert humanize.intcomma(number) == "10.000.000"
humanize.i18n.activate("fr_FR")
assert humanize.intcomma(number) == "10 000 000"

Expand Down

0 comments on commit b206342

Please sign in to comment.