bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: thousands separator


From: Aharon Robbins
Subject: Re: thousands separator
Date: Fri, 03 Jul 2009 11:57:41 +0300

Hi.

Please send text mails in the future.

It would help to know which version of gawk this is for Windows (how it
was compiled, where you got it).  It would also help to send the input
data; I don't really know off the top of my head what the dir command
outputs since I do gawk development under Linux.

This is undoubtedly some kind of locale issue; Windows systems have
limited or nonexistent support for these kinds of things.

If you set LC_ALL=C in the environment, that might help, but in this case
you won't get a thousands separator at all.

Let's try something simpler.  What happens if you run:

        BEGIN { printf("%'d\n", 123456789 }

Do you always get the same output? What is it?

Thanks,

Arnold

> GNU Awk 3.1.6
> 
> dir | dirsum.bat
> 
>     @echo off 
>     gawk -f c:\c\util\dirsum.awk            (with -W traditional produces a 
> constant character rather than random)
> 
> 
>         BEGIN { FS = " " } 
>         { print } 
>         /^[^ ]/ { gsub(/,/ , "", $4) ; sum+= $4 } 
>         END { print "" ; printf "        Matching Files : %'15d\n" , sum }
> 
> 
> Rather than a comma thousands separator a random character is substituted.
> 
> In some cases this seems to be effected by what the current working directory 
> is.
> 
> with "-W traditional" produces a constant character "e" rather than a random 
> character
> 
> 
> 3.1.5 has different behavior but doesn't produce commas either.
> 
> Thanks,
> Gary




reply via email to

[Prev in Thread] Current Thread [Next in Thread]