java Double封装类的对象保留两位小数
2014-09-07 23:57 VinpleZhang 阅读(759) 评论(0) 编辑 收藏 举报double value = 22.365454;
DecimalFormat df = new DecimalFormat("##.00");
value = Double.parseDouble(df.format(value));
System.out.println(value);
double value = 22.365454;
DecimalFormat df = new DecimalFormat("##.00");
value = Double.parseDouble(df.format(value));
System.out.println(value);