java中的四舍五入并保留位数

double s1=Double.parseDouble(String.format("%.4f", s));

s是一个字符串

posted @ 2019-08-12 22:57  Angry-rookie  阅读(140)  评论(0)    收藏  举报