NumberFormat nf   =   NumberFormat.getPercentInstance();   
System.out.println(nf.format(0.47));
显示:47%

DecimalFormat df1 = new DecimalFormat("##.00%");    //##.00%   百分比格式,后面不足2位的用0补齐
System.out.println(df1.format(fen));
显示:47.00%

 

相关文章:

  • 2022-12-23
  • 2021-09-17
  • 2022-12-23
  • 2022-12-23
  • 2021-12-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-03
  • 2022-12-23
  • 2021-11-16
  • 2021-12-07
  • 2021-11-05
  • 2022-12-23
相关资源
相似解决方案