This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug localedata/12394] New: thousands grouping bug when rounding requires an extra leading digit


http://sourceware.org/bugzilla/show_bug.cgi?id=12394

           Summary: thousands grouping bug when rounding requires an extra
                    leading digit
           Product: glibc
           Version: 2.12
            Status: NEW
          Severity: normal
          Priority: P2
         Component: localedata
        AssignedTo: libc-locales@sources.redhat.com
        ReportedBy: ajschorr@alumni.princeton.edu


Created attachment 5191
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5191
C code to demonstrate the bug

The attached program printthou.c gives buggy results:

bash-4.1$ echo 999.999 999999.999 | printthou
1000.00
,000,000.00

The program is using printf with the format "%'.2f".  As you can
see, those inputs expose bugs in the logic.

These inputs give the expected results:

bash-4.1$ echo 1000 1000000 | printthou
1,000.00
1,000,000.00

Regards,
Andy

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]