Padding belongs to the display form of an identifier. Keeping IDs as strings preserves meaningful leading zeroes.
Worked example
print(str(42).zfill(6))Result
000042Implementation notes
Converting a padded identifier to an integer discards its width. Keep the source string if external systems consider 007 and 7 different records.
Try it yourself
Try an ID shorter than the target width and one already longer.
Open the Python example →Editorial date August 11, 2026 · Published December 6, 2026