日期:2014-05-17 浏览次数:20783 次
private static void mytest11() {
String str = "10000002500.00";
String src = str.split("\\.")[0];
StringBuilder sb = new StringBuilder();
char[] strChar = src.toCharArray();
for (int i = strChar.length - 1; i >= 0; i--) {
sb.append(strChar[i]);
if ((strChar.length-i) % 3 == 0) {
sb.append(",");
}
}
System.out.println(sb.reverse().toString() + ".00");
}
NumberFormat nf = new DecimalFormat(",##0.00");
nf.format(100000000.00)