renhui
int diliverNum=3;//举例子的变量
int queryMailNum=9;//举例子的变量
// 创建一个数值格式化对象   
NumberFormat numberFormat = NumberFormat.getInstance();   
// 设置精确到小数点后2位   
numberFormat.setMaximumFractionDigits(2);   
String result = numberFormat.format((float)diliverNum/(float)queryMailNum*100);
System.out.println("diliverNum和queryMailNum的百分比为:" + result + "%");  

 

分类:

技术点:

相关文章:

  • 2021-11-14
  • 2021-09-17
  • 2022-01-29
  • 2022-02-02
  • 2022-01-10
  • 2021-11-25
  • 2022-01-29
猜你喜欢
  • 2021-09-17
  • 2021-09-17
  • 2021-10-10
  • 2022-01-29
  • 2021-12-25
  • 2021-11-14
相关资源
相似解决方案