}
try{
- String pattern = "-?\\d{1,9}(.\\d{0,9})?";
+ String pattern = "-?\\d{0,9}(.\\d{0,9})?";
if (value.matches(pattern)){
if ("-".equals(value)){
- return;
- }
- BigDecimal number = new BigDecimal(value);
- if((start != null && number.compareTo(start) < 0 || (end != null && number.compareTo(end) > 0))){
- exception = new NumberFormatException("You entered a number that is not within the allowed bounds.");
- throw exception;
+ //accept entry
+ }else{
+ BigDecimal number = new BigDecimal(value);
+ if((start != null && number.compareTo(start) < 0 || (end != null && number.compareTo(end) > 0))){
+ exception = new NumberFormatException("You entered a number that is not within the allowed bounds.");
+ throw exception;
+ }
}
}else{
exception = new NumberFormatException("You entered a number that is not within the allowed bounds.");