Double d = new Double(3);
NumberFormat nf = NumberFormat.getInstance();
System.out.println(nf.format(d));
java中,小数为0,保留整数,不为0,保留小数
最新推荐文章于 2023-02-20 17:30:38 发布
Double d = new Double(3);
NumberFormat nf = NumberFormat.getInstance();
System.out.println(nf.format(d));