`
xxchao12
  • 浏览: 13686 次
社区版块
存档分类
最新评论

四舍五入最好的最快的方法,其他什么的都是浮云!

阅读更多
public static void main(String[] args) {
// TODO Auto-generated method stub
//四舍五入最好的方法!
double d = 3.1455926;
System.out.println(Math.round(d*100)*0.01);
}
/*    java 中,Math.round(d*100)*0.01,要输出“元.角分”保留2位小数的,最方便了,其他神马的都是浮云!!
*/
 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics