Created attachment 1123773 [details] Program shows the problem. Description of problem: strfmon_l does not group digits. Version-Release number of selected component (if applicable): Fedora 23 x86_64 glibc-2.22-7.fc23.x86_64 How reproducible: Always. Steps to Reproduce: 1. Compile attached test program: $ gcc -Wall strfmon_test.c 2. Make sure there is no LC_ environment variables. 3. Run test program: $ LANG=en_US.UTF-8 ./a.out Actual results: Current locale not set: # 1 strfmon: 1000000000.00 # 2 strfmon_l: USD 1000000000.00 # 3 <<< NOTE THIS LINE. Current locale set: # 4 strfmon: USD 1,000,000,000.00 # 5 strfmon_l: USD 1,000,000,000.00 # 6 Line #2: Current locale is not set, so "C" locale is in use. strfmon gives correct result for "C" locale. Line #3: It is incorrect result. "en_US" locale has only partial effect: international currency symbol is printed before the value. however, digits of value are NOT grouped, as expected. Expected results: Current locale not set: strfmon: 1000000000.00 strfmon_l: USD 1,000,000,000.00 Current locale set: strfmon: USD 1,000,000,000.00 strfmon_l: USD 1,000,000,000.00 Both lines started with strfmon_l are expected to be the same. Additional info: This behavior is not specific for en_US.UTF-8 locale. It can be reproduced with fr_FR.UTF-8, ru_RU.UTF-8, etc.
One more test: Current locale set to fr_FR, but strfmon_l called with en_US locale. Result of strfmon_l: USD 1 000 000 000,00 Note: strfmon_l takes currency symbol (including it position before the value) from locale argument (en_US), while grouping symbol and decimal mark (space and comma respectively) are taken from current locale (fr_FR). (See test source in attachment strfmon_test_2.c)
Created attachment 1123775 [details] Another test program.
(In reply to Van de Bugger from comment #1) > One more test: > > Current locale set to fr_FR, but strfmon_l called with en_US locale. Result > of strfmon_l: > > USD 1 000 000 000,00 > > Note: strfmon_l takes currency symbol (including it position before the > value) from locale argument (en_US), while grouping symbol and decimal mark > (space and comma respectively) are taken from current locale (fr_FR). Yes, ___printf_fp always operates on the global locale object, and strfmon_l calls it internally to do the formatting.
glibc-2.22-15.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-68abc0be35
glibc-2.22-15.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-68abc0be35
New 2.23 backport: commit 90c0f166e9fd6b2c7685437558cf7e8f8bc6876a Author: Florian Weimer <fweimer> Date: Mon Apr 4 15:18:13 2016 +0200 strfmon_l: Use specified locale for number formatting [BZ #19633] (cherry picked from commit 985fc132f23dbb83de76c5af9e783ef1b5900148)
glibc-2.23.1-6.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-b321728d74
glibc-2.22-15.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.
glibc-2.23.1-6.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-b321728d74
glibc-2.23.1-7.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-b321728d74
glibc-2.23.1-7.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-b321728d74
glibc-2.23.1-7.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.