How can I validate user input contain only 5 digits with 2 decimal. I am using below code to check 5 digits, but how to check 2 decimal.
if (!id.equals("")) {
try {
Integer.parseInt(id);
if (id.length() <= 5) {
return true;
}
} catch (NumberFormatException nfe) {
return false;
}
}