我想使用DecimalFormat类格式化一个双数。使用DecimalFormat格式化双数
我希望这是基于Locale打印。
代码:
DecimalFormat df = new DecimalFormat("#####,###,###.00");
String result = df.format(99999999999.99);
System.out.println(result);
实际输出:
99,999,999,999.99
预期输出:
99999,999,999.99
的[DecimalFormat的可变的组大小(http://stackoverflow.com/questions/10229716/decimalformat-variable-group-size)可能的复制 – azurefrog
@azurefrog:我们能否使用'String.format'对于这个用例呢? – Shankar