百分比设置

方式一:0%

NumberFormat    percent = NumberFormat.getOercentInstance();

//设置精确到几位小数

percent.setMaximumFractionDigits(1);

方式二:0.00%

DecimalFormat df = new DecimalFormat ("0.00%");

String str = df.format(要格式化的字段);

posted @ 2019-03-20 16:06  卡卡学习  阅读(263)  评论(0编辑  收藏  举报