DecimalFormat format = (DecimalFormat) NumberFormat.getPercentInstance();
format.applyPattern( "#####0 ");
String temp = format.format(Double.MAX_VALUE);
System.out.println(temp);
double a; // test
DecimalFormat df = new DecimalFormat( "###############0.00 ");// 16位整数位,两小数位
String temp = df.format(a);
System.out.println(temp);
时间: 2024-12-23 23:19:08