📜  如何在java代码示例中获得2位小数

📅  最后修改于: 2022-03-11 14:52:09.933000             🧑  作者: Mango

代码示例5
total = (double) 100 / listMember.size();
DecimalFormat df = new DecimalFormat("#.##");
String dx = df.format(total);
total = Double.valueOf(dx);