Sign in to follow this  
Followers 0
Xand3r

new implementation for isnumber...

3 posts in this topic

$test="1234"
MsgBox(0 , "" , _isnum($test)&":"&IsNumber($test))

Func _isnum($number)
    $len=StringLen($number)
    $string=StringFormat("[\\d]{%d}", $len)
    Return StringRegExp($number , $string , 0)
EndFunc


Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

Share this post


Link to post
Share on other sites



But that's not what IsNumber() does. IsNumber() checks the base type of the variable. What you're comparing to is StringIsDigit() which checks if a string contains only numbers 0-9.

Share this post


Link to post
Share on other sites

ok.... i wish i knew that 3 hours ago :mellow:)))))))))


Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0