fred rosenberger wrote:First, you have to define in English what determines if a set of characters is a number or not. What, EXACTLY is allowed, and what EXACTLY is NOT allowed. Just writing down 3 or 4 examples may be enough for your brain, but there are a LOT of implicit assumptions there.
Once you decide what the rules are, then you can start coding them. But until you define what the rules are, writing any code is pointless.
Garrett Rowe wrote:There's no built-in methods that do what you're asking for. There are a few algorithms I could think of to start. Obviously, there some ambiguity in the rules you've given thus far. would DEAD or FADE be parsed as a number or a w
Paul Clapham wrote:Okay, so if I encountered the string "two billion" then that would be a number? Or are you only interested in numbers rendered as digits? Is there a limit on the number of digits or would a string of 87 digits be a number?
And what about i (the square root of minus one)? Or e (the root of the natural logarithms)? Or pi?