ssbydk
 1 @Test
 2 public void txfloat() {
 3     // TODO 自动生成的方法存根
 4     int a=9;
 5     int b=7;
 6     DecimalFormat df=new DecimalFormat("0.00");
 7 
 8     System.out.println(df.format((float)a/b));
 9     System.out.println(df.format(a/(float)b));
10     System.out.println(df.format((float)a/(float)b));
11     System.out.println(df.format((float)(a/b)));
12 }

分类:

技术点:

相关文章:

  • 2021-10-19
  • 2021-10-23
  • 2021-10-19
  • 2022-01-02
  • 2022-02-10
  • 2021-08-30
  • 2021-10-19
  • 2021-10-24
猜你喜欢
  • 2022-01-01
  • 2021-12-20
  • 2021-06-21
  • 2021-11-18
  • 2021-12-23
相关资源
相似解决方案