[Django] #35197: floatformat combined with intcomma filters misformatting in Django 4.2.10

7 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Django

ungelesen,
15.02.2024, 05:56:4815. Feb.
an django-...@googlegroups.com
#35197: floatformat combined with intcomma filters misformatting in Django 4.2.10
-------------------------------------+-------------------------------------
Reporter: | Owner: nobody
nathangeffen |
Type: Bug | Status: new
Component: Template | Version: 4.2
system | Keywords: intcomma,
Severity: Normal | floatformat
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 1 |
-------------------------------------+-------------------------------------
A security bug was removed from the intcomma template filter in Django
4.2.10. But it appears a bug was introduced that misformats numbers when
the intcomma filter is combined with floatformat.
The problem is a leading comma is added to some numbers (I suspect it is
numbers with exactly 3 digits).

Example code that worked in 4.2.7 but now misformatting in 4.2.10:
{{total_amount|floatformat:"2"|intcomma}}

I have not filed a bug on this system before and hope to be able to attach
screenshots.
--
Ticket URL: <https://code.djangoproject.com/ticket/35197>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

ungelesen,
15.02.2024, 06:00:1715. Feb.
an django-...@googlegroups.com
#35197: floatformat combined with intcomma filters misformatting in Django 4.2.10
-------------------------------------+-------------------------------------
Reporter: nathangeffen | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 4.2
Severity: Normal | Resolution:
Keywords: intcomma, | Triage Stage:
floatformat | Unreviewed
Has patch: 0 | Needs documentation: 0

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

* Attachment "Screenshot 2024-02-15 at 12-59-39 Invoices GroundUp.png"
added.

Django

ungelesen,
15.02.2024, 06:00:2915. Feb.
an django-...@googlegroups.com
#35197: floatformat combined with intcomma filters misformatting in Django 4.2.10
-------------------------------------+-------------------------------------
Reporter: nathangeffen | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 4.2
Severity: Normal | Resolution:
Keywords: intcomma, | Triage Stage:
floatformat | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by nathangeffen):

* Attachment "Screenshot 2024-02-15 at 12-58-45 Invoices GroundUp.png"

Django

ungelesen,
15.02.2024, 06:02:0515. Feb.
an django-...@googlegroups.com
#35197: floatformat combined with intcomma filters misformatting in Django 4.2.10
-------------------------------------+-------------------------------------
Reporter: nathangeffen | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 4.2
Severity: Normal | Resolution:
Keywords: intcomma, | Triage Stage:
floatformat | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Description changed by nathangeffen:

Old description:

> A security bug was removed from the intcomma template filter in Django
> 4.2.10. But it appears a bug was introduced that misformats numbers when
> the intcomma filter is combined with floatformat.
> The problem is a leading comma is added to some numbers (I suspect it is
> numbers with exactly 3 digits).
>
> Example code that worked in 4.2.7 but now misformatting in 4.2.10:
> {{total_amount|floatformat:"2"|intcomma}}
>
> I have not filed a bug on this system before and hope to be able to
> attach screenshots.

New description:

A security bug was removed from the intcomma template filter in Django
4.2.10. But it appears a bug was introduced that misformats numbers when
the intcomma filter is combined with floatformat.
The problem is a leading comma is added to some numbers (I suspect it is
numbers with exactly 3 digits).

Example code that worked in 4.2.7 but now misformatting in 4.2.10:
{{total_amount|floatformat:"2"|intcomma}}

In the attached screenshots the bug is apparent. They are the same screen
displayed using 4.2.7 and 4.2.10. Note the leading comma before 3 digit
numbers in the one screenshot (that's 4.2.10).

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

Django

ungelesen,
15.02.2024, 06:03:3915. Feb.
an django-...@googlegroups.com
#35197: floatformat combined with intcomma filters misformatting in Django 4.2.10
-------------------------------------+-------------------------------------
Reporter: nathangeffen | Owner: nobody
Type: Bug | Status: closed

Component: Template system | Version: 4.2
Severity: Normal | Resolution: duplicate

Keywords: intcomma, | Triage Stage:
floatformat | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by David Sanders):

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

Comment:

Duplicate of #35172
--
Ticket URL: <https://code.djangoproject.com/ticket/35197#comment:2>

Django

ungelesen,
15.02.2024, 06:10:4015. Feb.
an django-...@googlegroups.com
#35197: floatformat combined with intcomma filters misformatting in Django 4.2.10
-------------------------------------+-------------------------------------
Reporter: nathangeffen | Owner: nobody
Type: Bug | Status: closed
Component: Template system | Version: 4.2
Severity: Normal | Resolution: duplicate
Keywords: intcomma, | Triage Stage:
floatformat | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Comment (by nathangeffen):

Apologies. Missed the original bug. Thanks for fixing.
--
Ticket URL: <https://code.djangoproject.com/ticket/35197#comment:3>

Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten