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

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

Re: GNU Awk 3.1.0 problem with float numbers with non-US locale


From: Aharon Robbins
Subject: Re: GNU Awk 3.1.0 problem with float numbers with non-US locale
Date: Wed, 21 Aug 2002 14:16:56 +0300

Greetings.  Re this:

> > Is that known problem or a bug? It works OK with older awk but not
> > the newest if locale (Start->Setting->Control Panel->Regional Options->
> > Location) is e.g. finnish?
>
> > Base number to sum XX (float) is: 10,000000 (float)

I suggest trying the following patch to see if this fixes the problem.

Thanks,

Arnold

*** ../gawk-3.1.1/main.c        Wed May  1 17:12:45 2002
--- main.c      Fri Aug  9 08:16:02 2002
***************
*** 194,205 ****
                mtrace();
  #endif /* HAVE_MCHECK_H */
        
! 
        setlocale(LC_CTYPE, "");
        setlocale(LC_COLLATE, "");
! #if HAVE_LC_MESSAGES
        setlocale(LC_MESSAGES, "");
  #endif
        bindtextdomain(PACKAGE, LOCALEDIR);
        textdomain(PACKAGE);
  
--- 206,227 ----
                mtrace();
  #endif /* HAVE_MCHECK_H */
        
! #if defined(LC_CTYPE)
        setlocale(LC_CTYPE, "");
+ #endif
+ #if defined(LC_COLLATE)
        setlocale(LC_COLLATE, "");
! #endif
! #if HAVE_LC_MESSAGES && defined(LC_MESSAGES)
        setlocale(LC_MESSAGES, "");
  #endif
+ #if defined(LC_NUMERIC)
+       /*
+        * Force the issue here. On some systems, gawk ends up
+        * printing output with commas for the decimal point.
+        */
+       setlocale(LC_NUMERIC, "C");
+ #endif
        bindtextdomain(PACKAGE, LOCALEDIR);
        textdomain(PACKAGE);
  




reply via email to

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