Opened 11 years ago

Last modified 11 years ago

#24913 closed Bug

Localize filter tag doesn't work for thousand separator then USE_L10N is False — at Version 3

Reported by: Krupin Dmitry Owned by: Ana Balica
Component: Internationalization Version: 1.7
Severity: Normal Keywords: localize
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Ana Balica)

In settings.py set
USE_L10N = False
USE_THOUSAND_SEPARATOR = True

In the template do this:

 {% localize on %}
      {{ object.price }}
 {% endlocalize %}

or

{{ object.price|localize }}

Switching on the localization doesn't trigger the USE_THOUSAND_SEPARATOR setting in case it's set to True.

I think in util.formats.number_format function should be something like this

 if use_l10n:
      force_grouping = True

Change History (3)

comment:1 by Ana Balica, 11 years ago

Triage Stage: Unreviewed → Accepted

Been able to reproduce with the latest Django 1.9.dev20150604012012. ​The documentation isn't very specific on this topic, even though it would feel natural that by switching on localization, the setting of USE_THOUSAND_SEPARATOR should be respected.

comment:2 by Ana Balica, 11 years ago

Needs tests: set
Owner: changed from nobody to Ana Balica
Status: new → assigned

comment:3 by Ana Balica, 11 years ago

Description: modified (diff)
Summary: localize filter tag not work for thousand separator then USE_L10N is False → Localize filter tag doesn't work for thousand separator then USE_L10N is False
Note: See TracTickets for help on using tickets.
Back to Top