DecimalFormat df2 = new DecimalFormat("###.00");
or:
(double) (Math.round(sd3*100)/100.0);
| 09下高一期终语文-平均分 | 09下期终英语-平均分 | 09高一下期中考试-平均分 |
| 71.66666666666667 | 124.0 | 195.66666666666666 |
=>
| 09下高一期终语文-平均分 | 09下期终英语-平均分 | 09高一下期中考试-平均分 | |
| 71.67 | 124.00 | 195.67 |
|
||||||||||||||
Java 保持小数点后若干位的操作 DecimalFormat df2 = new DecimalFormat("###.00");
or: (double) (Math.round(sd3*100)/100.0);
=>
|
||||||||||||||
|
Copyright © 2010 戈壁滩上的狗尾巴花 - All Rights Reserved
|
||||||||||||||
最新的三6条正面评论