
15-54
<space>
: If <space> and a + flag at the head of the result are designated when
the first character is not a sign in conversion with a sign, or when no
characters are created after a conversion with a sign, <space> is
ignored.
# : Conversion is done using the “Replacement format.” In conversion
with conversion designation symbol o, the precision is changed so that
the leading digit of the result becomes 0. In conversion with a
conversion designation symbol x (or X), “0x” (or 0X) is added so that
the first digit of the result is not 0. In conversion with conversion
designation symbols e, E, f, g or G, (even if there are no figures after
the decimal point) the decimal point character is always added to the
result. (In such conversion, the decimal point character is usually
added only when figures are present after the decimal point.) In
conversion with conversion designation symbols g and G, the o at the
end is not deleted. The operation in other conversion is not defined.
0 : In conversion with conversion designation symbols d, i, o, x, X, e, E, f,
g and G, the minimum field width is ensured by embedding 0 at the
head (after a sign or base). There is no embedding with <space>. If
a 0 flag and a - flag are designated at the same time, the 0 flag is
ignored. If conversion of precision is designated with conversion
designation symbols d, i, o, x, and X, a 0 flag is ignored. The
operation in cases where other conversion designation symbols are
used is not defined.
The meanings of the conversion designation signs is as follows.
d, i : Convert the value of an integer type argument to a character string of
decimals with a sign in a “[-] dddd” format. The minimum number of
digits displayed is determined by the designated precision. If a
converted value does not fill the minimum number of digits, the head is
embedded with 0s. The default precision is 1. If a value of 0 is
converted with precision 0, no character is output.
o, x, X
: Convert an integer type argument to a character string of an octal
number (o) or hexadecimal number (x or X)without a sign in a “dddd”
or hexadecimal number (x or X) format. The lower case letters
(abcdef) are used for the conversion designation symbol x and upper
case letters (ABCDEF) for the conversion designation symbol X. The
minimum number of digits displayed is determined by the designated
precision. If a value after conversion does not reach the minimum
number of digits, the head is embedded with 0s. The default precision
is 1. If a value of 0 is converted with precision 0, no characters are
output.
Comentarios a estos manuales