[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: setlocale() [Was: Re: NSNumberFormater test fails]
From: |
Wolfgang Lux |
Subject: |
Re: setlocale() [Was: Re: NSNumberFormater test fails] |
Date: |
Sat, 11 Feb 2012 12:08:45 +0100 |
Eric Wasylishen wrote:
> One interesting thing is neither NSLog nor -[NSString stringWithFormat:], on
> Cocoa or GNUstep, use the locale's decimal point (regardless of the setting
> of the AppKit locale, or the libc locale.)
Which may be less interesting if you read the documentation of the NSString
class. In the discussion of +stringWithFormat: you can find this in Apple's
documentation
https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html%23//apple_ref/doc/uid/TP40003744
This method is similar to localizedStringWithFormat:, but using the canonical
locale to format numbers. This is useful, for example, if you want to produce
“non-localized” formatting which needs to be written out to files and parsed
back later.
So it is nice to know that things actually work as documented. :-)
Wolfgang