保留1位小数使用Math方法:
(float) (Math.round(x * 10) / 10.0);
double转int四舍五入:
Integer.parseInt(new java.text.DecimalFormat("0").format(x));
保留1位小数使用Math方法:
(float) (Math.round(x * 10) / 10.0);
double转int四舍五入:
Integer.parseInt(new java.text.DecimalFormat("0").format(x));