`

JAVA显示百分比

阅读更多


DecimalFormat df = new DecimalFormat();
df.setMaximumFractionDigits(2);
df.setMinimumFractionDigits(2);

 

String str1 = df.format(a * 100.00 / c) + "%";
String str2 = df.format(b* 100.00 / c) + "%";

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics