Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fixed #21544 Problem with number format when not using L10N #2015

Closed
wants to merge 2 commits into from

2 participants

@yceruto

I think the configuration of the variable USE_L10N aims at in this case, determine the format of number and not condition the use of the grouping of thousands.

@apollo13
Owner

Misses tests and according to the ticket it's not yet clear if this change should be made or if it's just a documentation change.

@apollo13 apollo13 closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 2, 2013
  1. Fixed #21544 Problem with number format when not using L10N

    Yonel Ceruto González authored
  2. Fixed #21544 Problem with number format when not using L10N (Better s…

    Yonel Ceruto González authored
    …olution)
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 2 deletions.
  1. +1 −2  django/utils/numberformat.py
View
3  django/utils/numberformat.py
@@ -14,8 +14,7 @@ def format(number, decimal_sep, decimal_pos=None, grouping=0, thousand_sep='',
* grouping: Number of digits in every group limited by thousand separator
* thousand_sep: Thousand separator symbol (for example ",")
"""
- use_grouping = settings.USE_L10N and settings.USE_THOUSAND_SEPARATOR
- use_grouping = use_grouping or force_grouping
+ use_grouping = settings.USE_THOUSAND_SEPARATOR or force_grouping
use_grouping = use_grouping and grouping > 0
# Make the common case fast
if isinstance(number, int) and not use_grouping and not decimal_pos:
Something went wrong with that request. Please try again.