//待测试数据
int i = 100;
//得到一个NumberFormat的实例
NumberFormat nf = NumberFormat.getInstance();
//设置是否使用分组
nf.setGroupingUsed(false);
//设置最大整数位数
nf.setMaximumIntegerDigits(6);
//设置最小整数位数
nf.setMinimumIntegerDigits(6);
//输出测试语句
System.out.println(nf.format(i+1))

相关文章:

  • 2022-02-03
  • 2021-12-26
  • 2022-12-23
  • 2021-07-26
  • 2022-02-28
  • 2021-10-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-08
  • 2022-01-10
  • 2022-12-23
  • 2021-08-09
相关资源
相似解决方案