【发布时间】:2011-08-22 06:53:43
【问题描述】:
我的 uiBinder 中有这个:
声明为@UiField ValueBoxEditorDecorator importoEditor;在我的代码中。
它的行为正确:“50”显示为“50.0”。 现在我想将其显示为“50.00”,因为它是货币欧元值。
如何在该字段上设置数字格式化程序?
【问题讨论】:
标签: gwt double cell number-formatting
我的 uiBinder 中有这个:
声明为@UiField ValueBoxEditorDecorator importoEditor;在我的代码中。
它的行为正确:“50”显示为“50.0”。 现在我想将其显示为“50.00”,因为它是货币欧元值。
如何在该字段上设置数字格式化程序?
【问题讨论】:
标签: gwt double cell number-formatting
使用 GWT 的 NumberFormat...
用于设置...
String value = "50.00";
double valueAsDouble = NumberFormat.getDecimalFormat().parse(value);
为了得到……
double paramValue = 50.00;
String result = NumberFormat.getDecimalFormat().format(paramValue);
NumberFormat 有许多其他方便的静态方法,例如 getCurrencyFormat,它们尊重语言环境。看看吧!
【讨论】: