如何在 gwt Celltable 中提供 cellformatter
How to provide cellformatter in gwt Celltable
如何设置 table 单元格的格式?关于如何实现这一点的任何想法
从我的数据库中我得到“1000”,但我需要显示货币“$1000”
感谢大家的帮助
在 return 字符串时使用数字格式:
private static NumberFormat currencyFormat = NumberFormat.getCurrencyFormat("USD");
...
TextColumn<MyObject> amountColumn = new TextColumn<MyObject>() {
@Override
public String getValue(MyObject myObject) {
return currencyFormat.format(myObject.getAmount());
}
};
如何设置 table 单元格的格式?关于如何实现这一点的任何想法
从我的数据库中我得到“1000”,但我需要显示货币“$1000”
感谢大家的帮助
在 return 字符串时使用数字格式:
private static NumberFormat currencyFormat = NumberFormat.getCurrencyFormat("USD");
...
TextColumn<MyObject> amountColumn = new TextColumn<MyObject>() {
@Override
public String getValue(MyObject myObject) {
return currencyFormat.format(myObject.getAmount());
}
};