Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Re: How to check Inputs if Numeric

by davis (Vicar)
on Mar 31, 2004 at 14:52 UTC ( [id://341303]=note: print w/replies, xml ) Need Help??


in reply to Re: How to check Inputs if Numeric
in thread How to check Inputs if Numeric

Yours fails for negative numbers, and for strings with more than one decimal place


davis
It's not easy to juggle a pregnant wife and a troubled child, but somehow I managed to fit in eight hours of TV a day.

Replies are listed 'Best First'.
Re^3: How to check Inputs if Numeric
by pelagic (Priest) on Apr 01, 2004 at 08:18 UTC
    > Yours fails for negative numbers
    I know it's primitive. But I coded it in about 5 seconds and for some application it might be good enough.

    > , and for strings with more than one decimal place
    Not True. It declares anything containing something else than numbers and decimal ponit(s) as non-numeric.

    For a real application I'd use something like Abigail's Regexp::Common

    pelagic
    -------------------------------------
    I can resist anything but temptation.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://341303]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-03-19 04:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found