printf Precision
◄Up► ◄Contents► ◄Index► ◄Back►
────────────────────────────────────────────────────────────────────────────
The precision field contains a non-negative decimal integer
preceded by a period (.). The value specifies the number of digits
or characters printed, the number of decimal places, or the number
of significant digits.
Unlike the width specification, the precision specification can
cause truncation or rounding of the output.
When precision is omitted, the interpretation of the precision
value and the default depends on the type:
◄Integer: d, i, u, o, x, X ►
◄Floating-point: e, E, f, g, G ►
◄Character: c, s ►
If the precision specification is an asterisk (*), the next
argument supplies the value. The precision argument, an integer,
must precede the value being formatted.
-♦-