Jump to content

IsNumber()


Recommended Posts

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?

Link to comment
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.

Link to comment
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...

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...