discuss-gnustep
[Top][All Lists]
Advanced

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

Re: locale dependent printf


From: Michael Scheibler
Subject: Re: locale dependent printf
Date: Thu, 26 Apr 2001 16:09:28 +0200

Richard Frith-Macdonald <address@hidden> wrote:

>
> On Thursday, April 26, 2001, at 01:05 PM, Michael Scheibler wrote:
>
> >
> > I am using printf to print a float value and I am getting different
> > results
> > in an application using GNUstep/ObjC and Java (not JIGS) (result: 9,5)
> > compared to a dummy C application which only prints a float (result:
> > 9.5).
> > Is it possible that GNUstep sets some locale information which affects
> > printf's behaviour?
>
> GNUstep sets the locale from the standard environment variables using
> setlocale(LC_ALL, "").  See the setlocale() man page for details on
> what environment variables are used.
>

Then I think I have found another bug, because I don't have any possibility
to get a float number locale independent. I tried with [NSString
stringWithFormat: "%f", floatValue] and with [[NSNumber numberWithFloat:
floatValue] stringValue].
Even saving this NSNumber instance into a dictionary and writing it to a
file failed. I always get 9,5 instead of 9.5.




reply via email to

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