cancel
Showing results for 
Search instead for 
Did you mean: 

Test for Numeric Value

Former Member
0 Kudos

Hi All,

Quick question! is there a way to test for Numeric value in the Graphical mapping?

Thank you in Advance,

Danny

Accepted Solutions (1)

Accepted Solutions (1)

Shabarish_Nair
Active Contributor
0 Kudos

there is not standard function available. But you can write a small UDF with a logic of parseInt or parsedouble in it to check for a numeric value.

Former Member
0 Kudos

Hi,

Is there any class that i need to import to use parsedouble?

Shabarish_Nair
Active Contributor
0 Kudos

no. you wouldnt need any class.

Former Member
0 Kudos

I am using the below function, but for some reason it does not work.

String mynum = “Test”;

Mynum = integer.parseInt(Mynum)

if (mynum == parseFloat(mynum)){

return “Numeric”;

}

else{

return “NonNumeric”;

}

Message was edited by:

Danny Molepo

Former Member
0 Kudos

Hi

There is no way to check for numeric characters in Graphical Mapping.You can use this UDF for the same.Also you need not import any class for this.

function IsNumeric(strString)

// check for valid numeric strings

{

var strValidChars = "0123456789.-";

var strChar;

var blnResult = true;

if (strString.length == 0) return false;

// test strString consists of valid characters listed above

for (i = 0; i < strString.length && blnResult == true; i++)

{

strChar = strString.charAt(i);

if (strValidChars.indexOf(strChar) == -1)

{

blnResult = false;

}

}

return blnResult;

}

Thanks

Former Member
0 Kudos

Hi

You can also modify the above code to suit your needs.

Thanks

Former Member
0 Kudos

Hi MK,

Its works like charm. Thank you all for the quick response.

Regards,

D

Answers (1)

Answers (1)

prabhu_s2
Active Contributor
0 Kudos

nope....but u can check if a value is alphanum by some Proprietary code in UDF