public BigDecimal getBigDecimal(String fieldName) {
DbfField f = getField(fieldName);
String s = getString(fieldName);
if (s == null || s.trim().length() == 0) {
return null;
} else {
s = s.trim();
}
if (s.contains(NUMERIC_OVERFLOW)) {
return null;
}
int a = f.getNumberOfDecimalPlaces();
if (a==0)
return new BigDecimal(s);
else {
s = s.replace(',', '.');
MathContext mc = new MathContext(a);
return new BigDecimal(s, mc);
}
}
Enhancement: to parse fractional parts.
my dirty hack is: