I need to validate input
- can be an integer or float value like (5 or 5.20)
- can be an integer with percentage sign (5%)
- can be a float with percentage sign (5.20%)
how can I validate using jQuery expression for valid integer
or float
with percentage sign ?
Currently I am using this expression but it is not working for me.
num = input.toString();
if(num !="^100(\.(0){0,2})?$|^([1-9]?[0-9])(\.(\d{0,2}))?\%$") {
return false;
}