feat(locale): add space-dot and space-comma number formatting options, where the thousand separator is a space

This commit is contained in:
Herculino Trotta
2025-08-10 12:34:29 -03:00
parent 66a5e6d613
commit 65c61f76ff
2 changed files with 6 additions and 2 deletions

View File

@@ -18,11 +18,13 @@ def get_format(format_type=None, lang=None, use_l10n=None):
return "."
elif number_format == "CD":
return ","
elif number_format == "SD" or number_format == "SC":
return " "
elif format_type == "DECIMAL_SEPARATOR":
number_format = getattr(user_settings, "number_format", None)
if number_format == "DC":
if number_format == "DC" or number_format == "SC":
return ","
elif number_format == "CD":
elif number_format == "CD" or number_format == "SD":
return "."
elif format_type == "SHORT_DATE_FORMAT":
date_format = getattr(user_settings, "date_format", None)

View File

@@ -89,6 +89,8 @@ class UserSettingsForm(forms.ModelForm):
("AA", _("Default")),
("DC", "1.234,50"),
("CD", "1,234.50"),
("SD", "1 234.50"),
("SC", "1 234,50"),
]
date_format = forms.ChoiceField(