Works as expected in locale package as below (with en_IN installed, of
course):
{{{
In [1]: import locale
In [2]: locale.setlocale(locale.LC_ALL, 'en_IN')
Out[2]: 'en_IN'
In [3]: locale.format("%.2f", 100000.00, grouping=True)
Out[3]: '1,00,000.00'
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25920>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* needs_better_patch: => 0
* resolution: => invalid
* needs_tests: => 0
* needs_docs: => 0
Comment:
I think the solution here is to add formats for the `en_IN` locale (like
ff2e0896a3f7b566c8a0802b2191d30c6070c8f6, for example). Please send a pull
request if you can do that. I don't think there's much value in leaving an
open ticket for each locale that we're missing. Thanks!
--
Ticket URL: <https://code.djangoproject.com/ticket/25920#comment:1>
* status: closed => new
* resolution: invalid =>
Comment:
There is a complication in adding en_IN. Number grouping in en_IN is not
grouped on 'n' number of digits. First 3 (ones, tens and hundreds) are
grouped as a single group and the remaining digits are grouped as 2 digits
per group. This can be achieved with a NUMBER_GROUPING setting. So I don't
think this can be fixed by adding a locale.
--
Ticket URL: <https://code.djangoproject.com/ticket/25920#comment:2>
* type: Bug => New feature
* stage: Unreviewed => Accepted
Comment:
Confirmed, Django doesn't support this sort of grouping yet.
--
Ticket URL: <https://code.djangoproject.com/ticket/25920#comment:3>
* component: contrib.humanize => Internationalization
--
Ticket URL: <https://code.djangoproject.com/ticket/25920#comment:4>
* owner: nobody => jasisz
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/25920#comment:5>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/25920#comment:6>
Comment (by jasisz):
PR for this: https://github.com/django/django/pull/6693
It basically adds possibility to use more robust NUMBER_GROUPING using
style similar to POSIX locale grouping option.
--
Ticket URL: <https://code.djangoproject.com/ticket/25920#comment:7>
* stage: Accepted => Ready for checkin
Comment:
I looked at the pull request, and think it looks RTC for the following
reasons:
- Has tests
- Test suite passes
- Old functionality from previous tests remains unchanged.
--
Ticket URL: <https://code.djangoproject.com/ticket/25920#comment:8>
* needs_better_patch: 0 => 1
* stage: Ready for checkin => Accepted
Comment:
A bit of documentation is missing as noted on the PR.
--
Ticket URL: <https://code.djangoproject.com/ticket/25920#comment:9>
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/25920#comment:10>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"b5a1c3a6f50362b57603e1833e44bff5628dde3c" b5a1c3a]:
{{{
#!CommitTicketReference repository=""
revision="b5a1c3a6f50362b57603e1833e44bff5628dde3c"
Fixed #25920 -- Added support for non-uniform NUMBER_GROUPING.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25920#comment:11>