From cppreference printf the number between %
and optional .
character in a printf
format specifier is:
(optional) integer value or * that specifies minimum field width. The result is padded with space characters (by default), if required, on the left when right-justified, or on the right if left-justified. In the case when * is used, the width is specified by an additional argument of type int. If the value of the argument is negative, it results with the - flag specified and positive field width. (Note: This is the minimum width: The value is never truncated.)
It specifies minimum field width. If the result to be printed would have less characters than minimum field width, it would have been padded with spaces. Because the resulting string "123456.99"
has 9 characters, specifying field width that is lower or equal to 9
is going to make no difference.