Opened 5 years ago

Closed 4 years ago

Last modified 4 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@…> 5 years ago.
Allow localize to handle long values

Download all attachments as: .zip

Change History (5)

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

Allow localize to handle long values

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

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 4 years ago by thejaswi_puthraya

  • Component changed from Uncategorized to Internationalization

comment:3 Changed 4 years ago by jezdez

  • Resolution set to fixed
  • Status changed from new to closed

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

comment:4 Changed 4 years ago by jezdez

(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