1、每两个数字用逗号分隔
DecimalFormat df = new DecimalFormat("#,#0.00#");
df.setMaximumFractionDigits(2);//这里是小数位
Double d = new Double("1.2345666661E10");
System.out.println(df.format(d));
2、每三个数字用逗号分隔
DecimalFormat df = new DecimalFormat("###,##0.00");
df.setMaximumFractionDigits(2);
Double d = new Double("1.2345666661E10");
String str = fd.format(d);
3、保留两位小数,不用逗号分隔
DecimalFormat df = new DecimalFormat("#####0.00");
df.setMaximumFractionDigits(2);
Double d = new Double("1.2345666661E10");
String str = fd.format(d);