java保留小数点后两位怎么做

如题所述

double a= 0.026;
System.out.println(String.format("%.2f", a));
结果为0.03
温馨提示:答案为网友推荐,仅供参考
相似回答