numberformat moduler returns a reversed number as a string when
THOUSAND_SEPARATOR has letters with l18n.
{{{
# coding: utf-8
# mysite/formats/ko/formats.py
THOUSAND_SEPARATOR = u'comma'
}}}
{{{
{% load humanize %}
{{10000|intcomma}}
}}}
* current output : 10ammoc000
* correct output : 10comma000
--
Ticket URL: <https://code.djangoproject.com/ticket/24181>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Old description:
> Hi.
>
> numberformat moduler returns a reversed number as a string when
> THOUSAND_SEPARATOR has letters with l18n.
>
> {{{
> # coding: utf-8
> # mysite/formats/ko/formats.py
>
> THOUSAND_SEPARATOR = u'comma'
> }}}
>
> {{{
> {% load humanize %}
>
> {{10000|intcomma}}
> }}}
>
> * current output : 10ammoc000
> * correct output : 10comma000
New description:
Hi.
numberformat moduler returns a reversed number as a string when
THOUSAND_SEPARATOR has letters with l18n.
{{{
# mysite/formats/ko/formats.py
THOUSAND_SEPARATOR = 'comma'
}}}
{{{
{% load humanize %}
{{10000|intcomma}}
}}}
* current output : 10ammoc000
* correct output : 10comma000
--
--
Ticket URL: <https://code.djangoproject.com/ticket/24181#comment:1>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/24181#comment:2>
Comment (by timgraham):
Is there a real use case for a `THOUSAND_SEPARATOR` of length > 1?
--
Ticket URL: <https://code.djangoproject.com/ticket/24181#comment:3>
Comment (by hannal):
yes.
--
Ticket URL: <https://code.djangoproject.com/ticket/24181#comment:4>
Comment (by aaugustin):
Would you mind saying a bit more about that use case -- e.g. in what
language or country it happens?
--
Ticket URL: <https://code.djangoproject.com/ticket/24181#comment:5>
Comment (by hannal):
Oh, it was related to Korea and Korean, just for some people. So I don't
think my case is normal.
(`NUMBER_GROUPING=4` and `THOUSAND_SEPARATOR` is assigned by one comma and
one space for visibility)
Whether a length of `THOUSAND_SEPARATOR` is 1 or not(`THOUSAND_SEPARATOR`
isn't restrcited by a length), the case is not my intention.
--
Ticket URL: <https://code.djangoproject.com/ticket/24181#comment:6>
Comment (by claudep):
Why is "has patch" set? hannal, is there a patch somewhere?
--
Ticket URL: <https://code.djangoproject.com/ticket/24181#comment:7>
Comment (by hannal):
https://github.com/hannal/django/commit/f610ca66c622e2fc8059c4c2960fe1a3897987c0
I'm sorry I didn't know how I can attach the patch with "has patch".
Replying to [comment:7 claudep]:
> Why is "has patch" set? hannal, is there a patch somewhere?
--
Ticket URL: <https://code.djangoproject.com/ticket/24181#comment:8>
* component: Uncategorized => Utilities
* needs_tests: 0 => 1
* easy: 0 => 1
* stage: Unreviewed => Accepted
Comment:
Thanks, could you write a test for it, please?
--
Ticket URL: <https://code.djangoproject.com/ticket/24181#comment:9>
* status: new => assigned
* owner: nobody => varun
--
Ticket URL: <https://code.djangoproject.com/ticket/24181#comment:10>
Comment (by varun):
PR: https://github.com/django/django/pull/4081
--
Ticket URL: <https://code.djangoproject.com/ticket/24181#comment:11>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"540ca563dea624823e0b363f98302a78294836ad"]:
{{{
#!CommitTicketReference repository=""
revision="540ca563dea624823e0b363f98302a78294836ad"
Fixed #24181 -- Fixed multi-char THOUSAND_SEPARATOR insertion
Report and original patch by Kay Cha.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24181#comment:12>
Comment (by Claude Paroz <claude@…>):
In [changeset:"b44a56c3080312ab94679a396e6b60a18f9b6463"]:
{{{
#!CommitTicketReference repository=""
revision="b44a56c3080312ab94679a396e6b60a18f9b6463"
[1.8.x] Fixed #24181 -- Fixed multi-char THOUSAND_SEPARATOR insertion
Report and original patch by Kay Cha.
Backport of 540ca563de from master.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24181#comment:13>