I would like to share this little function with you. I have found it very useful for validating the input of various functions where the input must be a numerical value.
I hope you find it useful
Dim $aNumbers[21]
$aNumbers[1] = 12345
$aNumbers[2] = "-12345"
$aNumbers[3] = +12345.678
$aNumbers[4] = "12345.678"
$aNumbers[5] = "One"
$aNumbers[6] = ""
$aNumbers[7] = "123.One"
$aNumbers[8] = 0xFF1165AB
$aNumbers[9] = "0x0000Ff"
$aNumbers[10] = 0x0000
$aNumbers[11] = "0x0000GG"
$aNumbers[12] = 4.395179e+003
$aNumbers[13] = "4.395179e+003"
$aNumbers[14] = 4.395179e-003
$aNumbers[15] = "4.395179e-003"
$aNumbers[16] = 4e-003
$aNumbers[17] = 4E+003
$aNumbers[18] = "4e-003"
$aNumbers[19] = "4E+003"
For $i = 1 To 20 Step 1
MsgBox(0,"IsNumeric", '$aNumbers['& $i & '] = ' & $aNumbers[$i] & @CRLF & @CRLF & 'IsNumber() = ' & IsNumber($aNumbers[$i]) & @CRLF & @CRLF & 'IsString() = ' & IsString($aNumbers[$i]) & @CRLF & @CRLF & 'Number() = ' & Number($aNumbers[$i]) & @CRLF & @CRLF & '_IsNumerical() = ' & _IsNumerical($aNumbers[$i]) & @crlf )
Next
; #FUNCTION# ==============================================================
; Name...........: _IsNumerical
; Description ...: Uses a regular expression to check if $vValue can be interpreted as a numeric value
; Syntax.........: _IsNumerical($vValue)
; Parameters ....: $vValue - Value to test if it is numerical
; Return values .: True - If $vValue contains a numeric value
; ...............: False- If $vValue contains a non-numeric value
; Author ........: Bowmore <bowmore at lineone dot net>
; Modified.......:
; Remarks .......: Accepts values in Decimal, Hex and Exponential format. If $vValue is a string then
; the whole string must be numeric value for the function to return True
; Related .......: IsNumber, Number
; Link ..........:
; Example .......: Yes
; ===============================================================
Func _IsNumerical($vValue)
If IsNumber($vValue) Then Return True
If StringRegExp($vValue, "(^[+-]?[0-9]+\.?[0-9]*$|^0x[0-9A-Fa-f]{1,8}$|^[0-9]+\.?[0-9]*[Ee][+-][0-9]+$)") Then Return True
Return False
EndFunc
Edit: Added IsNumber() check to speed things up a bit.