protected static BigDecimal parseBigDecimal(final Object obj, final String type) throws ParseException {
    final BigDecimal result;
    try {
      result = new BigDecimal(obj.toString());
    } catch (NumberFormatException nfe) {
      throw new ParseException(obj + " is not a valid " + type + ".");
    }
    return result;
  }