Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#14053 closed (fixed)

django.utils.formats.localize() misses support for long

Reported by: David Danier <david.danier@…> Owned by: nobody
Component: Internationalization Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Seems like the isinstance(value, (decimal.Decimal, float, int))-check on line 83 fails to check for long values.

Simple test (german, USE_THOUSAND_SEPARATOR is True):

In [1]: from django.utils import formats

In [2]: formats.localize(10000)
Out[2]: u'10,000'

In [3]: formats.localize(10000L)
Out[3]: 10000L

Patch follows

Attachments (1)

django_localize_long_r13459.diff (577 bytes) - added by David Danier <david.danier@…> 6 years ago.
Allow localize to handle long values

Download all attachments as: .zip

Change History (5)

Changed 6 years ago by David Danier <david.danier@…>

Allow localize to handle long values

comment:1 Changed 6 years ago by David Danier <david.danier@…>

Has patch: set

comment:2 Changed 6 years ago by Thejaswi Puthraya

Component: UncategorizedInternationalization

comment:3 Changed 6 years ago by Jannis Leidel

Resolution: fixed
Status: newclosed

(In [13920]) Fixed #14053 -- Also localize long integers. Thanks, David Danier.

comment:4 Changed 6 years ago by Jannis Leidel

(In [13921]) [1.2.X] Fixed #14053 -- Also localize long integers. Thanks, David Danier.

Backport from trunk (r13920).

Note: See TracTickets for help on using tickets.
Back to Top