保留n位小数

String.format("%.2f", num)

那个2换成几就是保留几位小数

posted @ 2019-12-17 14:37  Ice_Blue_Brother  阅读(161)  评论(0编辑  收藏  举报