A format sequence consists of a percent
sign, followed by optional flags, width, and precision indicators, then
terminated with a field type character. The field type controls how the
corresponding sprintf argument is to be
interpreted, while the flags modify that interpretation.

The field type characters are:

Field|IntegerFormat------+--------------------------------------------------------------b|Convertargumentasabinarynumber.|Negativenumberswillbedisplayedasatwo's complement
| prefixed with `..1'.B|Equivalentto `b', but uses an uppercase 0B for prefix
| in the alternative format by #.
d | Convert argument as a decimal number.
i | Identical to `d'.o|Convertargumentasanoctalnumber.|Negativenumberswillbedisplayedasatwo's complement
| prefixed with `..7'.u|Identicalto `d'.
x | Convert argument as a hexadecimal number.
| Negative numbers will be displayed as a two'scomplement|prefixedwith `..f' (representing an infinite string of
| leading 'ff's).
X | Equivalent to `x',butusesuppercaseletters.Field|FloatFormat------+--------------------------------------------------------------e|Convertfloatingpointargumentintoexponentialnotation|withonedigitbeforethedecimalpointas[-]d.dddddde[+-]dd.|Theprecisionspecifiesthenumberofdigitsafterthedecimal|point(defaultingtosix).E|Equivalentto `e', but uses an uppercase E to indicate
| the exponent.
f | Convert floating point argument as [-]ddd.dddddd,
| where the precision specifies the number of digits after
| the decimal point.
g | Convert a floating point number using exponential form
| if the exponent is less than -4 or greater than or
| equal to the precision, or in dd.dddd form otherwise.
| The precision specifies the number of significant digits.
G | Equivalent to `g',butuseanuppercase `E' in exponent form.
a | Convert floating point argument as [-]0xh.hhhhp[+-]dd,
| which is consisted from optional sign, "0x", fraction part
| as hexadecimal, "p", and exponential part as decimal.
A | Equivalent to `a',butuseuppercase `X' and `P'.Field|OtherFormat------+--------------------------------------------------------------c|Argumentisthenumericcodeforasinglecharacteror|asinglecharacterstringitself.p|Thevaluingofargument.inspect.s|Argumentisastringtobesubstituted.Iftheformat|sequencecontainsaprecision,atmostthatmanycharacters|willbecopied.%|Apercentsignitselfwillbedisplayed.Noargumenttaken.

The flags modifies the behavior of the formats. The flag characters are:

For numeric fields, the precision controls the number of decimal places
displayed. For string fields, the precision determines the maximum number
of characters to be copied from the string. (Thus, the format sequence %10.10s will always
contribute exactly ten characters to the result.)