Is there a good reason why you change "d" to "s" here?
I copied this example from a actual DAOPhot table (and I just checked the original table again) and that definitely says `%-5d` in the second to last format.