• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Scanfloat & Locale
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scanfloat & Locale


  • Subject: Re: Scanfloat & Locale
  • From: Chris Kane <email@hidden>
  • Date: Wed, 3 Aug 2005 09:31:08 -0700

You are using the wrong key string constants in scannerLocale. Use the ones in NSUserDefaults.h instead for setting up a locale dictionary.

Confusing I know. And probably almost impossible for us to ever fix due to the existence of subclasses out there.


Chris Kane Cocoa Framework, Apple


On Jul 30, 2005, at 7:56 AM, Marco Michieli wrote:

I'm trying to scan a list of floats from an http page.

The float numbers use:
- "." as 1000 separator
- "," as decimal separator

I've set the locale for the Scanner to correctly recognize the separators, but it does not work.
The Scanner seems to completely ignore the locale settings.


Here below a simplified version of my code and the correspondent Run Log

What's wrong with my code?


Thanks

Marco

    [scannerLocale setObject:@"." forKey:NSLocaleGroupingSeparator];
    [scannerLocale setObject:@"," forKey:NSLocaleDecimalSeparator];

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Prev by Date: Re: NSNumberFormatter scientific notation
  • Next by Date: Re: XCode -- my forgetfulness -- how to set Copyright and other About panel stuff
  • Previous by thread: Re: NSNumberFormatter scientific notation
  • Next by thread: Re: XCode -- my forgetfulness -- how to set Copyright and other About panel stuff
  • Index(es):
    • Date
    • Thread