Talk:Determine if a string is numeric: Difference between revisions

m (Reverted edits by 81.95.151.136 (Talk); changed back to last version by JimD)
(New section: Objective-C question)
Line 51:
:: I hadn't realized that there was an ambiguity. I hadn't even realized that "isnumeric" is a VB function (I certainly don'ty know VB). In the two examples I contributed (IDL and TCL) I assumed that the task meant that something would be interpreted as a number if handed to the language in question. I.e. if I can multiply it with two or take the sin() of it then it is numeric. For example in IDL I might say "sin(double(x))" where "double(x)" converts the input into a "double" (8-byte float) which will fail if "x" is, for example, the string "foo". I trap the error and decide what is or isn't "numeric" based on the occurrence of this kind of error. This will allow "1.1" or "-.1e-04" or "+000003" etc.
:: Should we tag the task for clarification? [[User:Sgeier|Sgeier]] 10:34, 20 September 2007 (MDT)
 
== Objective-C question ==
 
An anonymous user had posted a question about the Objective-C example. I'll try to translate.
 
"How to check the whole string to make sure it is numeric?" was the original question. I think they were looking for a character by character check? Maybe a regex? What do you Ob-C people think? --[[User:Mwn3d|Mwn3d]] 21:46, 11 December 2008 (UTC)
Anonymous user