`

DecimalFormat用法 数字类型文本格式转化

 
阅读更多
//String custom="#,###,00";
//String custom="#,###,00.00";
String custom="00.00%";//注意 若为百分比 则数字需先处以100
//......


double d = 1112312323.123123;
DecimalFormat df = new DecimalFormat(custom);
String text = df.format(d);

System.err.println(text);

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics