标签:四舍五入 str 没有 format java ble int mat ring
Double htert=34.9768;
DecimalFormat df = new DecimalFormat("#.00");// 保留五位小数非四舍五入型
df.setRoundingMode(RoundingMode.DOWN); //这个设置很重要,没有这个设置就会四舍五入
String strhtert = df.format(htert);
System.out.println(strhtert);
标签:四舍五入 str 没有 format java ble int mat ring
原文地址:https://www.cnblogs.com/Anders888/p/11899837.html