> Note that if USE_L10N is set to True, then the locale-dictated format
has higher precedence and will be applied instead.
However, the same page of the documentation says about
`USE_THOUSAND_SEPARATOR`:
> 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.
These two quotes are kind of contradictory, because obviously one really
can't use `USE_THOUSAND_SEPARATOR` without `USE_L10N`. The latter quote is
plain wrong in most cases, as most locales define thousands separators.
`THOUSAND_SEPARATOR` and `NUMBER_GROUPING` are really only respected if
`USE_L10N = True`, `USE_THOUSAND_SEPARATOR = True` and the locale doesn't
specify a thousands separator. I think it would be great to just use
`USE_THOUSAND_SEPARATOR` without `USE_L10N` and manually set
`THOUSAND_SEPARATOR` and `NUMBER_GROUPING`, but that is currently not
possible.
Anyway, I think the discrepancy should at least be removed form the
documentation.
Regards,
Felix
--
Ticket URL: <https://code.djangoproject.com/ticket/25928>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* cc: f30@… (added)
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/25928#comment:1>
* stage: Unreviewed => Accepted
Comment:
Could you submit a pull request with the proposed clarifications?
--
Ticket URL: <https://code.djangoproject.com/ticket/25928#comment:2>
* status: new => assigned
* owner: nobody => Wingie
Comment:
can you take a look and see if the clarifications are correct?
https://github.com/Wingie/django/tree/ticket_25928
--
Ticket URL: <https://code.djangoproject.com/ticket/25928#comment:3>
Comment (by F30):
Replying to [comment:3 Wingie]:
> can you take a look and see if the clarifications are correct?
>
> https://github.com/Wingie/django/tree/ticket_25928
Looks good to me, it precisely describes the current behavior.
You could get rid of the ":setting:`USE_L10N` is set to ``True``, and"
part in the second paragraph though, as the previous paragraph already
states that `USE_L10N` must always be `True`. I find that repetition
rather confusing.
One could also ask if a behavior which requires such verbose explanations
is really sensible, but that's out of scope for this bug report.
Thanks for the fix,
Felix
--
Ticket URL: <https://code.djangoproject.com/ticket/25928#comment:4>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"abcf3fe68410ff9ffdfe72df9e925efd044d6ff6" abcf3fe6]:
{{{
#!CommitTicketReference repository=""
revision="abcf3fe68410ff9ffdfe72df9e925efd044d6ff6"
[1.9.x] Fixed #25928 -- Clarified precendence of USE_THOUSAND_SEPARATOR
and locale formats.
Backport of 7f218d98915ef3e76a98ef72075a6bde907dfe41 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25928#comment:5>
Comment (by Tim Graham <timograham@…>):
In [changeset:"7f218d98915ef3e76a98ef72075a6bde907dfe41" 7f218d98]:
{{{
#!CommitTicketReference repository=""
revision="7f218d98915ef3e76a98ef72075a6bde907dfe41"
Fixed #25928 -- Clarified precendence of USE_THOUSAND_SEPARATOR and locale
formats.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25928#comment:6>