标签:style blog http color io java for div sp
正常版:
//正常版: import java.text.DecimalFormat; import java.math.RoundingMode; DecimalFormat formater = new DecimalFormat(); formater.setMaximumFractionDigits(2); formater.setGroupingSize(0); formater.setRoundingMode(RoundingMode.FLOOR); System.out.println(formater.format(123456.7897456));
简化版:(这个是四色五入,本人亲测.)
// 简化版:(这个是四色五入,本人亲测.) import java.text.DecimalFormat; DecimalFormat formater = new DecimalFormat("#0.##"); System.out.println(formater.format(123456.7897456));
取自: http://zhidao.baidu.com/link?url=Wd2GiFvfu_rGGqObUi2HSftJjQhZy9SmCNBr4jrXuezuTB8xk1stNin7JFIc8bIG2ELmaPEU7LGO_lt6SjwcZa
标签:style blog http color io java for div sp
原文地址:http://www.cnblogs.com/mjorcen/p/3985739.html