Project

General

Profile

« Previous | Next » 

Revision 5c875358

Added by Andreas Müller almost 4 years ago

ref #9038 slightly adapted the regEx for StatisticalMeasurementValue BigDecimal

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/BigDecimalWithLabelElement.java
40 40
        }
41 41

  
42 42
        try{
43
            String pattern = "-?\\d*.?\\d{0,10}";
43
            String pattern = "-?\\d{0,9}.?\\d{0,9})";
44 44
            if (value.matches(pattern)){
45 45
                BigDecimal number = new BigDecimal(value);
46 46
                if((start != null && number.compareTo(start) < 0 || (end != null && number.compareTo(end) > 0))){
......
80 80

  
81 81
    public BigDecimal getBigDecimal(){
82 82
        String text = super.getText();
83
        if (StringUtils.isBlank(text) || "-".equals(text)){
84
            return null;
85
        }
83 86
        try {
84
            return StringUtils.isBlank(text) ? null : new BigDecimal(text);
87
            return new BigDecimal(text);
85 88
        } catch (NumberFormatException e) {
86 89
            exception = e;
87 90
            return null;

Also available in: Unified diff