Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

%-6.2d, what does the .2 mean

Name: Anonymous 2011-02-18 17:21

Alright, so I've searched the book I'm learning from, as well as the internet, and can't seem to find an answer to this...so I am turning to /prog/ as my last resort:
in the conversion specification %-6.2g, what does the .2 mean?
I know that the -6 means that there are a maximum of 6 characters shown, and that it is left justified, but the book doesn't mention what the number following a decimal means.
Help is greatly appreciated, thanks in advance

Name: man 3 printf 2011-02-18 18:32

   The precision
       An optional precision, in the form of a period ('.')   followed  by  an
       optional  decimal  digit string.  Instead of a decimal digit string one
       may write "*" or "*m$" (for some decimal integer m) to specify that the
       precision  is  given  in  the  next  argument, or in the m-th argument,
       respectively, which must be of type int.  If the precision is given  as
       just  '.',  or  the precision is negative, the precision is taken to be
       zero.  This gives the minimum number of digits to appear for d,  i,  o,
       u, x, and X conversions, the number of digits to appear after the radix
       character for a, A, e, E, f, and F conversions, the maximum  number  of
       significant  digits  for  g and G conversions, or the maximum number of
       characters to be printed from a string for s and S conversions.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List