public static DataField newAmountField(String name, int columns, Class<?> mappedType) {
return newAmountField(name, columns, "'$'#,##0.00", 2, mappedType);
}
public static DataField newDecimalField(String name, int columns, String pattern, int decimalPlaces, Class<?> mappedType) {
DecimalFormatter editFormatter = new DecimalFormatter(pattern, decimalPlaces, mappedType);
DecimalFormatter displayFormatter = new DecimalFormatter(pattern, decimalPlaces, mappedType);
DataField df = newDataField(name, columns, new DefaultFormatterFactory(displayFormatter, displayFormatter, editFormatter, null));
return df;
}