Alternate Forms for printf Conversion

Top 

 

If you use the # flag conversion character, it has the following effect on the argument (arg) being converted:

Conversion character

   How # affects the argument

 

c s d iu

   No effect.

0

   0 is prepended to a nonzero arg.

x X

   0x (or 0X) is prepended to arg.

e E f

   The result always contains a decimal point even if no digits follow the point.           Normally, a decimal point appears in these results only if a digit follows it.

g G

   Same as e and E, except that trailing zeros are not removed.