List of usage examples for java.text NumberFormat parseObject
public Object parseObject(String source) throws ParseException
From source file:org.apache.empire.struts2.jsp.controls.TextInputControl.java
protected Object parseDecimal(String s, NumberFormat nf) { // Try to convert try {// w w w. ja v a 2 s .co m // Check for characters for (int i = 0; i < s.length(); i++) { if (s.charAt(i) >= 'A') return error(FieldErrors.InputNoNumberFormat, null, s); } // Parse String return nf.parseObject(s); } catch (Exception e) { return error(FieldErrors.InputNoNumberFormat, null, s); } }