NumberFormat formatter = NumberFormat.getNumberInstance();
formatter.setMinimumIntegerDigits(5);
formatter.setGroupingUsed(false);
String sno = formatter.format(1);
System.out.println("sno = " + sno);
输出
sno = 00001
作者:鲨鱼辣椒灬
来源:CSDN
NumberFormat formatter = NumberFormat.getNumberInstance();
formatter.setMinimumIntegerDigits(5);
formatter.setGroupingUsed(false);
String sno = formatter.format(1);
System.out.println("sno = " + sno);
输出
sno = 00001
作者:鲨鱼辣椒灬
来源:CSDN