1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
ListGridField storenettotal = new ListGridField("StoreNetTotal", myMessages.lst_storenettotal());
storenettotal.setEmptyCellValue("--");
storenettotal.setType(ListGridFieldType.FLOAT);
storenettotal.setCellFormatter(new CellFormatter() {
public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
if (value instanceof Number) {
try {
NumberFormat nf = NumberFormat.getCurrencyFormat();
return nf.format(((Number) value).floatValue());
} catch (Exception e) {
return value.toString();
}
} else {
return value == null ? null : value.toString();
}
}
}); |
Partager