#33281: Thousand separator is the wrong character
--------------------------------------------+------------------------
               Reporter:  Demetris Stavrou  |          Owner:  nobody
                   Type:  Uncategorized     |         Status:  new
              Component:  Uncategorized     |        Version:  3.2
               Severity:  Normal            |       Keywords:
           Triage Stage:  Unreviewed        |      Has patch:  0
    Needs documentation:  0                 |    Needs tests:  0
Patch needs improvement:  0                 |  Easy pickings:  0
                  UI/UX:  0                 |
--------------------------------------------+------------------------
 Given the following configuration:

 {{{
 # settings.py
 LANGUAGE_CODE = 'el-gr'
 USE_L10N = False
 USE_THOUSAND_SEPARATOR = True
 THOUSAND_SEPARATOR = ","
 NUMBER_GROUPING = 3
 }}}

 {{{
 # views.py
 class ThousandView(TemplateView):
     template_name = "thousand_template.html"

     def get_context_data(self, **kwargs):
         context = super().get_context_data(**kwargs)
         context["test_number"] = 1234
         return context
 }}}

 {{{
 # thousand_template.html
 {% load humanize %}
 <!DOCTYPE html>
 <html lang="en">
 <head>
   <meta charset="UTF-8">
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <title>Document</title>
 </head>
 <body>
   {{ test_number|intcomma }}
 </body>
 </html>
 }}}

 one would expect that the `test_number` value is rendered as `1,234`.
 However, it is rendered as `1.234`. I intentionally used `el-gr` because
 the locale defines the thousand separator to be `.`. As shown in the
 settings, this shouldn't matter since we use `USE_L10N=False`. However, it
 seems that it affects the result, because if `en-us` is used instead, then
 the number is rendered as `1,234`.

 **Testing this with Django version 3.1.13, works as expected**, i.e. given
 the above configuration, the number is correctly rendered as `1,234`.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33281>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.ecb2628a3aded98718639c1fec2b0f20%40djangoproject.com.

Reply via email to