DecimalFormat dfx = new DecimalFormat("#.00"); double d = 12.3456; double d2 = dfx.format(d); // 此时d2的值为12.35