This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Thousands' grouping flag in printf() format string
- From: Laszlo Ersek <LACOS at ludens dot elte dot hu>
- To: cygwin at cygwin dot com
- Date: Fri, 04 Jun 2004 20:18:02 +0200
- Date: Fri, 4 Jun 2004 20:18:01 +0200
- Subject: Thousands' grouping flag in printf() format string
I'd like to ask whether there is any intention to implement the X/Open
extension ' (0x27) printf() format flag. (Numbered argument specifications
work (thanks to Jeff Johnston), and they are an X/Open extension too.)
I encountered this problem using cygwin-1.5.10-3 on an XP.
Illustration:
--------
#define _XOPEN_SOURCE
#include <stdio.h>
#include <assert.h>
#include <locale.h>
int main(void)
{
assert(setlocale(LC_NUMERIC, ""));
/* This works. */
printf("%1$d %1$d\n", 1000);
/* This does not, even if LC_NUMERIC is C. */
printf("%'d\n", 1001);
return 0;
}
--------
Thank you
Laszlo Ersek
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/