Skip to content

Commit

Permalink
Fix NumberFormatException with binding and number length > 4
Browse files Browse the repository at this point in the history
  • Loading branch information
wodencafe committed Dec 24, 2017
1 parent e65655e commit aed2969
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import java.text.NumberFormat;
import java.util.Locale;

import java.text.NumberFormat;

import org.vaadin.ui.shared.numberfield.NumberFieldState;
import org.vaadin.ui.shared.numberfield.NumberValidator;

Expand Down Expand Up @@ -317,7 +319,9 @@ private String getValueAsFormattedDecimalNumber() {
synchronized (decimalFormat) {
setDecimalFormatToNumberFieldAttributes();
// Number valueAsNumber = decimalFormat.parse(value);
Number valueAsNumber = Double.valueOf(value.toString());
NumberFormat format = NumberFormat.getInstance(Locale.US);
Number valueAsNumber = format.parse(value);

return decimalFormat.format(valueAsNumber);
}
} catch (Exception e) {
Expand Down

0 comments on commit aed2969

Please sign in to comment.