cancel
Showing results for 
Search instead for 
Did you mean: 

UDF to validate Numeric value

Former Member
0 Kudos

Hi PI Experts,

I am trying to validate a field whether it is a Numeric or not.

I have used below UDF's and have checked few blogs too.

UDF-1

********

try{ Integer.parseInt(num); } catch(NumberFormatException nfe) { return "false"; } return "true";

UDF - 2

*****

int x = 0;

try{ Integer.parseInt(a);

return "true";

}

catch(NumberFormatException e)

{

return "false";

}

https://archive.sap.com/discussions/thread/533354

Above UDFs working fine up to 10 digits, and it is not validating for more than 10 digits.

I am getting out put as "false" for numeric value contains more than 10 digits.

Please help me out by providing appropriate UDF to validate more than 10 digits.

Thank you,

Chakradhar N

Accepted Solutions (1)

Accepted Solutions (1)

markangelo_dihiansan
Active Contributor

Hi,

You can use this code.

UDF is simple type

Regards,

Mark

Answers (1)

Answers (1)

Former Member

Hi Mark,

Thanks a lot for providing an UDF. It is working and issue got resolved.

Thank you,

Chakradhar N