Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

A format specifier begins with a % character. After the percent sign come the following elements, in this order:

  1. An optional argument zero-offset index specifier (that is, the first item has index 0), [index ":"].

  2. An optional left justification indicator, ["-"].

  3. An optional width specifier, [width].

  4. An optional precision specifier, ["." prec].

  5. The conversion type character, type.

The following table summarizes the possible values for type.

...

A width specifier sets the minimum field width for a conversion. If the resulting string is shorter than the minimum field width, it is padded with blanks to increase the field width. The default is to right-justify the result by adding blanks in front of the value, but if the format specifier contains a left-justification indicator (an "-" en dash character preceding the width specifier), the result is left-justified by adding blanks after the value.