如何生成0001,0002,0003.....类似于foramt?等
如何生成0001,0002,0003.....类似于foramt?等
如果整数位数不够就补0生成字符串,如果整数位数超出就将此整数直接生成字符串
1 -> 0001
2 -> 0002
3 -> 0003
....
12345 -> 12345
123456 -> 123456
------解决方案--------------------1.ToString( "D5 ") -> > 5位数字
1.ToString( "F5 ") -> > 5位小数
------解决方案--------------------If Len(Counts)=1 Then
Counts= "0000 "&Counts
End If
If Len(Counts)=2 Then
Counts= "000 "&Counts
End If
If Len(Counts)=3 Then
Counts= "00 "&Counts
End If
If Len(Counts)=4 Then
Counts= "0 "&Counts
End If