Repository navigation
How to set thousands and decimal separators to intword? #93
Description
Activity
- changed the title
[-]How to set thousands and decimal separator?[/-][+]How to set thousands and decimal separators?[/+]on Jan 31, 2023 Hi, we need three things.
First, use the language code "it_IT" rather than "Italian":
humanize.i18n.activate("it_IT")Second, for
humanize.thousands_separator()andhumanize.decimal_separator(), we need to addit_ITinto:Lines 16 to 27 in 1feba83
# Mapping of locale to thousands separator _THOUSANDS_SEPARATOR = { "de_DE": ".", "fr_FR": " ", "pt_BR": ".", } # Mapping of locale to decimal separator _DECIMAL_SEPARATOR = { "de_DE": ",", "pt_BR": ",", } Finally,
intworddoesn't yet usethousands_separatoranddecimal_separator. We should add support, perhaps similar to howintcommadoes it: #53.Second, for
humanize.thousands_separator()andhumanize.decimal_separator(), we need to addit_ITinto:Done #98
Finally,
intworddoesn't yet usethousands_separatoranddecimal_separator. We should add support, perhaps similar to howintcommadoes it: #53.I'm not able to open a PR about it :(
No problem, I'll have a look when I gave time, unless someone else would like to check it :) And thanks for the other PRs.
Reacted by Andrea Borruso- changed the title
[-]How to set thousands and decimal separators?[/-][+]How to set thousands and decimal separators to `intword`?[/+]on Feb 4, 2023 No problem, I'll have a look when I gave time, unless someone else would like to check it :) And thanks for the other PRs.
This is a great project, thank you very much
Done in #287.
What did you do?
Hi, in Italian the thousands separator is
,(comma )and the decimal one is.(dot).If I activate Italian -
_t = humanize.i18n.activate("Italian")- and runhumanize.intword(1234559), I get1.2 milioniand not1,2 milioni.And If I run
humanize.thousands_separator()I have,.What did you expect to happen?
To have Italian separators, i.e. have them inverted.
What actually happened?
I wrote it above
What versions are you using?
Thank you