Method

IsNumeric


Description

Indicates whether the value passed is numeric.

Usage

result = IsNumeric(value)

Part

Type

Description

result

Boolean

True if value is numeric; False otherwise.

value

Variant

Variable, value, or object whose data type is being investigated.

Notes

A common usage of IsNumeric is to determine whether a user entered a string that can be converted to a number.

Strings greater than 127 characters always return False.

Sample code

If the value passed to IsNumeric is a String that contains the string version of a number, then IsNumeric returns True. For example this code returns True:

Var b As Boolean
b = IsNumeric("3.1416")

This code returns False:

Var b As Boolean
b = IsNumeric("Hello")

Check a user-entered string:

Var value As Double
Var b As Boolean
b = IsNumeric(TextField1.Text)
If b Then
  value = TextField1.Text.ToDouble
End If

Compatibility

All project types on all supported operating systems.