Revision d002d872
Added by Katja Luther almost 4 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/BigDecimalWithLabelElement.java | ||
---|---|---|
40 | 40 |
} |
41 | 41 |
|
42 | 42 |
try{ |
43 |
BigDecimal number = new BigDecimal(value); |
|
44 |
if((start != null && number.compareTo(start) < 0 || (end != null && number.compareTo(end) > 0))){ |
|
43 |
String pattern = "-?\\d*.?\\d{0,10}"; |
|
44 |
if (value.matches(pattern)){ |
|
45 |
BigDecimal number = new BigDecimal(value); |
|
46 |
if((start != null && number.compareTo(start) < 0 || (end != null && number.compareTo(end) > 0))){ |
|
47 |
exception = new NumberFormatException("You entered a number that is not within the allowed bounds."); |
|
48 |
throw exception; |
|
49 |
} |
|
50 |
}else{ |
|
45 | 51 |
exception = new NumberFormatException("You entered a number that is not within the allowed bounds."); |
46 | 52 |
throw exception; |
47 | 53 |
} |
Also available in: Unified diff
ref #9038: check value with regex if fit in BigDecimal