[Bug 1901770] [NEW] n_sign_posn from localeconv wrong for en_US locale

Launchpad Bug Tracker 1901770 at bugs.launchpad.net
Tue Oct 27 23:15:44 UTC 2020


You have been subscribed to a public bug:

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.

** Affects: glibc (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: accounting currency format locale localeconv number
-- 
n_sign_posn from localeconv wrong for en_US locale
https://bugs.launchpad.net/bugs/1901770
You received this bug notification because you are a member of Ubuntu Foundations Bugs, which is subscribed to glibc in Ubuntu.



More information about the foundations-bugs mailing list