import java.text.NumberFormat;

//获取格式化对象
NumberFormat format = NumberFormat.getPercentInstance();

//设置百分数精确度2即保留两位小数
format.setMinimumFractionDigits(2);

//最后格式化并输出
System.out.println("百分数:" + format.format(percent));

  

相关文章:

  • 2022-12-23
  • 2021-11-05
  • 2022-12-23
  • 2022-12-23
  • 2021-12-25
  • 2021-12-04
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-17
  • 2021-12-25
  • 2021-12-25
  • 2021-11-14
相关资源
相似解决方案