n_sign_posn from localeconv wrong for en_US locale

Bug #1901770 reported by Joe Cool
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
glibc (Ubuntu)
Won't Fix
Undecided
Unassigned

Bug Description

NAME="Ubuntu"
VERSION="18.04.4 LTS (Bionic Beaver)"

The `n_sign_posn` from `localeconv()` is wrong for the en_US locale. This means that Accounting formats will put a negative sign before the value instead of wrapping the value in parens. Code:

    python
    Python 3.6.9 (default, Jul 17 2020, 12:50:27)
    [GCC 8.4.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import locale
    >>> locale.setlocale(locale.LC_ALL, 'en_US')
    'en_US'
    >>> locale.localeconv()
    {'int_curr_symbol': 'USD ', 'currency_symbol': '$', 'mon_decimal_point': '.', 'mon_thousands_sep': ',', 'mon_grouping': [3, 3, 0], 'positive_sign': '', 'negative_sign': '-', 'int_frac_digits': 2, 'frac_digits': 2, 'p_cs_precedes': 1, 'p_sep_by_space': 0, 'n_cs_precedes': 1, 'n_sep_by_space': 0, 'p_sign_posn': 1, 'n_sign_posn': 1, 'decimal_point': '.', 'thousands_sep': ',', 'grouping': [3, 3, 0]}

Here is the Windows version:

    {'int_curr_symbol': 'USD', 'currency_symbol': '$', 'mon_decimal_point': '.', 'mon_thousands_sep': ',', 'mon_grouping': [3, 0], 'positive_sign': '', 'negative_sign': '-', 'int_frac_digits': 2, 'frac_digits': 2, 'p_cs_precedes': 1, 'p_sep_by_space': 0, 'n_cs_precedes': 1, 'n_sep_by_space': 0, 'p_sign_posn': 3, 'n_sign_posn': 0, 'decimal_point': '.', 'thousands_sep': ',', 'grouping': [3, 0]}

The correct value (0) means that negative numbers get wrapped in ( ). The ubuntu value of 1 means that a minus sign precedes the value.

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Thanks for your report!

Ubuntu uses the locale definitions provided by glibc, and this kind of request should be made via an upstream bug report:

https://sourceware.org/bugzilla/enter_bug.cgi?product=glibc;component=localedata

If you file such a bug, please include a convincing justification of the proposed change. Just claiming that the current value is "wrong" won't make the upstream maintainers too happy. ;)

affects: langpack-locales (Ubuntu) → glibc (Ubuntu)
Revision history for this message
Steve Langasek (vorlon) wrote :

Indeed, declaring that a leading minus sign is "wrong", and parentheses are "right", for the US locale, is not supported by common usage. Both are widely used in different contexts, and Ubuntu does not deviate from the upstream behavior.

We are also certainly not going to change the behavior on the 2-year-old stable release that you reported this against.

To have this changed for future releases, please discuss with upstream as suggested.

Changed in glibc (Ubuntu):
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.