zero padded string

gbreed at cix.compulink.co.uk gbreed at cix.compulink.co.uk
Thu Aug 23 17:28:10 CEST 2001


In article <mailman.998578654.6960.python-list at python.org>, hnowak at cuci.nl 
(Hans Nowak) wrote:

> Do you mean something like this?
> 
> >>> '%09d' % 42
> '000000042'

There's also string.zfill(42,9) or string.zfill("42",9)


                  Graham



More information about the Python-list mailing list