java的double类型format java的double类型format:
//最多保留几位小数,就用几个#,最少位就用0来确定 DecimalFormat df = new DecimalFormat("##0.0#"); String s=df.format(d);