Doh… I catch the logic on. I specified width field (=8). The number printed is aligned within these 8 characters. All unoccupied positions are filled with a fiiler (‘0’ in my case). Hence the output which confused me.
The fill and alignment parameters are about decorating the output field as a string. The width parameter is going to determine how your number looks. You might want to specify a zero-fill on numbers with no alignment, though.
So {X:0>8} says “make a field 8 chars wide, fill it with ‘0’, then put the hex value at the ‘>’ side of the field.”
If you don’t specify a fill, what is the default for numbers, ‘0’ or ’ ’ (space)?
I wanted automatically added leading zeroes, so that numbers are always 8 chars long. This is exactly what C’s '%.8X' does. I tried '{X:08}' among others, but it does not work as needed.