it template
{% localize on %}
{{ object.price }}
{% endlocalize %}
or
{{ object.price|localize }}
but there is no affect
I think in util.formats.number_format function should be something like
this
if use_l10n:
force_grouping = True
--
Ticket URL: <https://code.djangoproject.com/ticket/24913>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* stage: Unreviewed => Accepted
* needs_tests: => 0
* needs_docs: => 0
Comment:
Been able to reproduce with the latest Django 1.9.dev20150604012012.
[https://docs.djangoproject.com/en/1.8/topics/i18n/formatting/#localize
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.
--
Ticket URL: <https://code.djangoproject.com/ticket/24913#comment:1>
* status: new => assigned
* owner: nobody => ana-balica
* needs_tests: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/24913#comment:2>
Old description:
> in settings.py
> '''USE_L10N = False
> USE_THOUSAND_SEPARATOR = True'''
>
> it template
> {% localize on %}
> {{ object.price }}
> {% endlocalize %}
> or
> {{ object.price|localize }}
>
> but there is no affect
>
> I think in util.formats.number_format function should be something like
> this
> if use_l10n:
> force_grouping = True
New description:
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
}}}
--
--
Ticket URL: <https://code.djangoproject.com/ticket/24913#comment:3>
Comment (by timgraham):
Elsewhere [https://docs.djangoproject.com/en/stable/ref/settings/#use-
thousand-separator docs say], "When USE_L10N is set to True and if this is
also set to True, Django will use the values of THOUSAND_SEPARATOR and
NUMBER_GROUPING to format numbers." so I think this might be invalid.
--
Ticket URL: <https://code.djangoproject.com/ticket/24913#comment:4>
* status: assigned => closed
* resolution: => duplicate
Comment:
This is a duplicate of #21544 which I think is a valid issue.
--
Ticket URL: <https://code.djangoproject.com/ticket/24913#comment:5>