You might get some ideas from this Python demo script, it pads floating point values to a width of 6 characters, 0 decimal places, then pads with zeros and converts to a string. I am sure that you could develop a code block to perform the same in the field calculator
Code:
'''
PaddingStringsDemo.py
'''
vals = [1,10,100,1000]
for i in vals:
out = "%06.0f" % (i)
print str(out)
the result is
Code:
000001
000010
000100
001000
changing the "out" line to
out = "%08.2f" % (i)
yields
Code:
00001.00
00010.00
00100.00
01000.00
so you can see it is quite flexible.
Bookmarks