Sign in to follow this  
Followers 0
HighGuy

IsNumber()

3 posts in this topic

Shouldn't the following code give the same return value?

MsgBox(0, "", IsNumber(42))  ; returns 1
MsgBox(0, "", IsNumber("42"))   ; returns 0

If this is the intended behavior how can I check if a string represents a number?

Share this post


Link to post
Share on other sites



If this is the intended behavior how can I check if a string represents a number?

StringIsDigit

--------------------------------------------------------------------------------

Checks if a string contains only digit (0-9) characters.

MsgBox(0, "", StringIsDigit(42))    ; returns 1
MsgBox(0, "", StringIsDigit("42"))  ; returns 1

Conclusion:

No bug.

Share this post


Link to post
Share on other sites

Check out StringIsInt and StringIsFloat as well.


David Nuttall
Nuttall Computer Consulting

An Aquarius born during the Age of Aquarius

AutoIt allows me to re-invent the wheel so much faster.

I'm off to write a wizard, a wonderful wizard of odd...

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