Subject: NetBSD printf(3) doesn't understand the posix thousands' grouping
To: None <tech-userlevel@netbsd.org>
From: Tobias Nygren <tnn+nbsd@nygren.pp.se>
List: tech-userlevel
Date: 05/27/2006 02:09:10
Hi,
I stumbled upon a problem with printf(3) when porting a program.
The following code:

#include <stdio.h>
#include <stdint.h>

int main(void) {
        int32_t x = 12345;
        int64_t y = 12345;
        printf("%i %'i\n", x, x);
        printf("%lld %'lld\n", y, y);
}

Procudes the output:
$ ./test
12345 'i
12345 'lld

When the expected result would be(C locale):
$ ./test
12345 12345
12345 12345

The single quote flag is defined by posix in
http://www.rdg.opengroup.org/onlinepubs/007908799/xsh/fprintf.html

Is there any reason why this is not implemented?

Please cc replies to me.

Thanks,
-Tobias