• 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: API to convert string to number?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: API to convert string to number?


  • Subject: Re: API to convert string to number?
  • From: "Shawn Erickson" <email@hidden>
  • Date: Tue, 27 Feb 2007 13:45:59 -0800

On 2/27/07, E. Wing <email@hidden> wrote:
I was wondering if there was a good Cocoa API to convert a string to a
float or double. I have been using strtod/strtof, but I noticed that
it doesn't handle commas and presumably other localization issues.
I've been avoiding scanf for safety issues.

Review the docs for NSNumberFormatter , NSScanner, and also consider -[NSString floatValue] and friends.

-Shawn
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: API to convert string to number?
      • From: "E. Wing" <email@hidden>
References: 
 >API to convert string to number? (From: "E. Wing" <email@hidden>)

  • Prev by Date: Re: API to convert string to number?
  • Next by Date: question about null
  • Previous by thread: Re: API to convert string to number?
  • Next by thread: Re: API to convert string to number?
  • Index(es):
    • Date
    • Thread