Printing a number in standard thousand format using printf
Hi,
Please see the C program below.
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
int main (int argc, char* argv[])
{
setlocale (LC_ALL, "");
printf ("%'llu\n", strtoull("109488", (char**) NULL, 10));
return 0;
}
When it's compiled and run on a Redhat 6.6 Linux machine, the output is
109,488
When it's compiled and run on a Ubuntu 14.04.3 LTS machine, the output is
1,09,488
Could someone please tell how can I get the 1st output (109,488) on the second machine (Ubuntu) ?
Thank you.
|