NumberFormat percentFormat = NumberFormat.getPercentInstance();
BigDecimal r = new BigDecimal(1)
.divide( new BigDecimal(2), 2, BigDecimal.ROUND_HALF_UP);
System.out.println("本地默认格式输出百分数:" + percentFormat.format(r));
注意:整数除法是直接舍掉小数部分的,想实现整数除法的四舍五入必须先对整数进行转换