Code example for NumberFormat

Methods: parse

0
            this.max = max;
        } 
 
        public Object stringToValue(String string) throws ParseException
        { 
            Number res = formatter.parse(string);
            if (res.intValue() < min || res.intValue() > max)
            { 
                throw new ParseException("Out of range", 0);
            } 
 
            return res;
        } 
 
        public String valueToString(Object object) throws ParseException
        { 
            if (object == null)
            { 
                return null; 
            }