java保留两位小数

double f = 111231.5585;

System.out.println(String.format("%.2f", f))
posted @ 2022-01-15 23:20  northli  阅读(22)  评论(0编辑  收藏  举报