public void parseAmount(final String str,final ErrorDrain errors){
  try {
    final String numberString=str.replace(',','.');
    setAmount((int)Math.round(Double.parseDouble(numberString)));
    setType(new ExpressionType(ExpressionType.NUMERAL));
    normalized=amount.toString();
  }
 catch (  final NumberFormatException e) {
    errors.setError("illegal number format: '" + str + "'");
  }
}

public void parseAmount ( final String str , final ErrorDrain errors ) { try { final String numberString = str . replace ( ',' , '.' ) ; setAmount ( ( int ) Math . round ( Double . parseDouble ( numberString ) ) ) ; setType ( new ExpressionType ( ExpressionType . NUMERAL ) ) ; normalized = amount . toString ( ) ; } catch ( final NumberFormatException e ) { errors . setError ( "illegal number format: '" + str + "'" ) ; } }
parse the given numeric expression and assign the value to ' amount ' . todo mf - we may switch from integer to long if we extend the column type in table ' words '
