How to distinguish whether a variable is a pure numeric string or a number, such as "123" and "123".
HI Guys.
I want to know how to distinguish whether a variable is a pure numeric string or a number, such as "123" and "123".
I only know an inelegant way.
ClassMethod IsNumber(n)
{
s ret=0
try{
s ret= $lb(n)=$lb(+n)
}catch e{
s ret=0
}
q ret
}
Is there any other way to implement it
Product version: Caché 2016.1
$ZV: Cache for Windows (x86-64) 2016.2 (Build 736U) Fri Sep 30 2016 11:46:02 EDT