0% found this document useful (0 votes)
28 views3 pages

1 Code For Non Negative Number

Uploaded by

Sadiq Shaik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views3 pages

1 Code For Non Negative Number

Uploaded by

Sadiq Shaik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Create a Edit Validate Rule and call it on Property Advanced Tab

Double doubleInput;

if (theValue != null)

if(theValue.contains("."))

String s = "" + theValue;

String[] result = s.split("\\.");

if (result[0].length()>6 || result[1].length()>2){

theProperty.addMessage("Sorry, there’s a problem with the data you’ve entered");

return false;

else if(theValue.length()>6)

{ -

theProperty.addMessage("Sorry, there’s a problem with the data you’ve entered");

return false;

else if(theValue != null)

try

doubleInput = new Double(theValue.toString());

catch (java.lang.NumberFormatException ex)


{

return false;

if (doubleInput.doubleValue() < 0)

theProperty.addMessage("Enter a non-negative number");

return false;

return true;

You might also like