Hey all,
I have a browse screen on an Order Entity, which has a String currencyCode ( USD, EUR, GBP), and an BigDecimal invoiceAmount.
On the invoiceAmount column I want to add a formatter, so I can add a currencySymbol before the amount.
But this currency differs per order. Does anyone know if it still is possible with the column formatter ?
The format method just takes the BigDecimal value as input, so I can’t dynamically change the currencySymbol.
Formatter<BigDecimal> formatter = new Formatter<BigDecimal>() {
@Nullable
@Override
public String format(@Nullable BigDecimal value) {
if (value != null) {
String format = currencySymbol + " " + value;
return format;
} else {
return null;
}
}
};
ordersTable.getColumn("invoiceAmount").setFormatter(formatter);