I always have to know why, rather than just how, so here I go:
How does this work:
'{0:01.2f}'.format(5.555) #returns '5.55'
'{0:01.1f}'.format(5.555) #returns '5.5'
'{0:1.2f}'.format(5.555) #returns '5.55' again
'{0:1.1f}'.format(5.555) #returns '5.5' again
Why does this not add zero padding by returning '05.5' instead of just '5.5' when I have the extra zero. It just doesn't seem to work.
Also, why is the string 0:1.1f instead of 0:0.1f, etc. Is it just a convention to use the number 1 before the decimal instead of a zero, or is that the syntax?