Skip to main content
Version: v6.7.0

If-Number

Command Description​

Determine if the data is a numeric value (can be converted to a decimal or an integer)

Command Prototype​

bRet = IsNumeric(varData)

Parameter Description​

ParameterRequiredTypeDefaultDescription
varDataTrueexpression$PrevResultThe data to be determined

return​

bRet,The variable used to save the output of the command.

Demo​

TracePrint("------------------------------------------------ is a numeric value------- --------------------------") 
//-------------------------------------------------------------------------------
//[Remarks] Determine whether the data type is a numeric value.
//Input parameter 1:
// varData----->target data
//out parameters:
// returns the result of whether it is a numeric value, true and false
a = "111"
bRet = IsNumeric(a)
TracePrint("Let the variable a be 111, judge whether it is a numerical value, the result is: ")
TracePrint(bRet)

a = "Hello UiBot"
bRet = IsNumeric(a)
TracePrint("Let the variable a be Hello UiBot to judge whether the variable a is a numerical value, the result is: ")
TracePrint(bRet)