代码:Double a = 7.50;java.text.DecimalFormat df = new java.text.DecimalFormat("#0.00"); //("#0.00")你想保留几位写几位!df.format(a);测试结果:7.50