[Django] #33771: Localized thousand separator

14 views
Skip to first unread message

Django

unread,
Jun 7, 2022, 7:54:57 PM6/7/22
to django-...@googlegroups.com
#33771: Localized thousand separator
-------------------------------------+-------------------------------------
Reporter: srunow | Owner: nobody
Type: Bug | Status: new
Component: Template | Version: 4.0
system | Keywords: thousand separator
Severity: Normal | template
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Using thousand separator with |intcomma (USING_THOUSAND_SEPARATOR is not
set) and additional |floatformat: leads to wrong localized output.

{{{
context = {"exfloat": 1000.01, "exint": 1000}
[...]
{{ exfloat|intcomma }} # output: 1.000,01 -> correct
{{ exfloat|floatformat:2|intcomma }} # output: 1,000,01 -> wrong
{{ exfloat|floatformat:-2|intcomma }} # output: 1,000,01 -> wrong
{{ exint|intcomma }} # output: 1.000 -> correct
{{ exint|floatformat:2|intcomma }} # output: 1,000,00 -> wrong
{{ exint|floatformat:-2|intcomma }} # output: 1.000 -> correct
}}}

Localization is German, no possible setting following the documentation is
fixing this.

--
Ticket URL: <https://code.djangoproject.com/ticket/33771>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 7, 2022, 8:25:44 PM6/7/22
to django-...@googlegroups.com
#33771: Localized thousand separator
-------------------------------------+-------------------------------------
Reporter: srunow | Owner: nobody
Type: Bug | Status: closed
Component: Template system | Version: 4.0
Severity: Normal | Resolution: fixed
Keywords: thousand separator | Triage Stage:
template | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by srunow):

* status: new => closed
* resolution: => fixed


Comment:

The solution is "2g" for example, as described in documentation. Referal
to floatformat on localizing sites containing information about thousand
separator may be advised. Found the answer after looking up the
implementation and was wondering, why the docs didn't state that (but
found it now).

--
Ticket URL: <https://code.djangoproject.com/ticket/33771#comment:1>

Django

unread,
Jun 10, 2022, 1:07:22 PM6/10/22
to django-...@googlegroups.com
#33771: Localized thousand separator
-------------------------------------+-------------------------------------
Reporter: srunow | Owner: nobody
Type: Bug | Status: closed
Component: Template system | Version: 4.0
Severity: Normal | Resolution: invalid

Keywords: thousand separator | Triage Stage:
template | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* resolution: fixed => invalid


--
Ticket URL: <https://code.djangoproject.com/ticket/33771#comment:2>

Reply all
Reply to author
Forward
0 new messages