code: private Number parseNumber(String numberValue, Object valueSource) throws WrongValueTypeException {
  
      try {
        Double d = Double.valueOf(numberValue);
        return this.mathUtil.toSimplestNumber(d);
      } catch (NumberFormatException e) {
        throw new WrongValueTypeException(e, numberValue, valueSource, Number.class);
      }
    }
docs: This method parses a numeric value.
  
  @param numberValue is the number value as string.
  @param valueSource describes the source of the value. This may be the filename where the value was read
  from, an XPath where the value was located in an XML document, etc. It is used in exceptions
  thrown if something goes wrong. This will help to find the problem easier.
  @return the value as number.
  @throws WrongValueTypeException if the given string is no number.