Re: NSString doubleValue and zero
Re: NSString doubleValue and zero
- Subject: Re: NSString doubleValue and zero
- From: Robert Tillyard <email@hidden>
- Date: Tue, 18 Feb 2003 23:39:29 +0000
You could use a function similar to this.
Bool isStringNumeric (const char *String)
{
const char *p;
p = String;
while (*p)
if (!isdigit (*p ++) && *p != '.')
return (False);
return (True);
}
Regards, Rob.
On Tuesday, February 18, 2003, at 09:21 pm, olivier wrote:
I use the message doubleValue to get a number value out of a string.
If the string is not a number then i need to store the string. My
problem is that if the string is not a number then doubleValue return
0.
But then how am i supposed to know when it is an actual number with
value 0 or a string that was not a number.
Any pointers appreciated
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.