Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Converting doubles to strings




On Nov 11, 2005, at 2:45 PM, Ian Anderson wrote:

Yes, if that string is going to go into the UI of your app you ought to use a CFNumberFormatter.

I have a question about doing the opposite. Does CFNumberFormatter detect formatting error in a string when converting it to number? To be specific, can I use CFNumberFormatter to help filtering text field input?


I tried CFNumberFormatterGetValueFromString to convert a string to floating number. It happily accepts string like "1.2.aa" and converts it to 1.2 and returns true. Is there any way to report such error?

--
Stephen Chu <mailto:email@hidden>
Rampage Systems, Inc. <http://www.rampageinc.com/>

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: Converting doubles to strings (From: Laurence Harris <email@hidden>)
 >Re: Converting doubles to strings (From: Ian Anderson <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.