#25928 closed Bug (fixed)
Documentation on THOUSAND_SEPARATOR and NUMBER_GROUPING is still misleading
Reported by: | Felix Dreissig | Owned by: | Wingston SHaron |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | f30@… | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The THOUSAND_SEPARATOR
and NUMBER_GROUPING
settings are only used if the current locale doesn't specify a thousands separator. This has been reported in #15918 and the following sentence has been added to the documentation:
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
Change History (6)
comment:1 by , 9 years ago
Cc: | added |
---|
comment:2 by , 9 years ago
Triage Stage: | Unreviewed → Accepted |
---|
follow-up: 4 comment:3 by , 9 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
can you take a look and see if the clarifications are correct?
comment:4 by , 9 years ago
Replying to Wingie:
can you take a look and see if the clarifications are correct?
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
Could you submit a pull request with the proposed clarifications?