Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Build break - commaizenumber



On Tue, Mar 15, 2011 at 10:01:36AM -0500, Eric Haszlakiewicz wrote:
> and it doesn't seem to work with a recently built system (as of yesterday):
> 
> # printf "%'d\n" 12345
> printf: %': invalid directive
> 
> What am I missing?

printf(1) != printf(3)

In addition, the thousand separator is a locale specific concept, many
locales don't set one. Try 

#include <locale.h>
#include <stdio.h>

int main(void)
{
        setlocale(LC_ALL, "");
        printf("%'d\n", 8000000);
}

Compare LC_ALL=C and LC_ALL=pt_BR.ISO8859-1.

Joerg


Home | Main Index | Thread Index | Old Index