=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/printf/printf.1,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- src/usr.bin/printf/printf.1 1998/09/27 16:57:50 1.5 +++ src/usr.bin/printf/printf.1 1998/11/30 01:48:02 1.6 @@ -1,4 +1,4 @@ -.\" $OpenBSD: printf.1,v 1.5 1998/09/27 16:57:50 aaron Exp $ +.\" $OpenBSD: printf.1,v 1.6 1998/11/30 01:48:02 aaron Exp $ .\" Copyright (c) 1989, 1990 The Regents of the University of California. .\" All rights reserved. .\" @@ -61,7 +61,6 @@ The .Ar arguments after the first are treated as strings if the corresponding format is -either .Cm b , .Cm c or @@ -115,24 +114,25 @@ .Ar num . .El .Pp -Each format specification is introduced by the percent character -(``%''). +Each format specification is introduced by the percent +.Pq Sq \&% +character. The remainder of the format specification includes, in the following order: .Bl -tag -width Ds .It "Zero or more of the following flags:" .Bl -tag -width Ds .It Cm # -A `#' character -specifying that the value should be printed in an ``alternate form''. -For +Specifies that the value should be printed in an +.Dq alternate form . +For the .Cm c , .Cm d , and .Cm s formats, this option has no effect. For the .Cm o -formats the precision of the number is increased to force the first +format the precision of the number is increased to force the first character of the output string to a zero. For the .Cm x .Pq Cm X @@ -155,18 +155,30 @@ formats, trailing zeros are not removed from the result as they would otherwise be. .It Cm \&\- -A minus sign `\-' which specifies +Specifies the .Em left adjustment of the output in the indicated field. .It Cm \&+ -A `+' character specifying that there should always be +Specifies that there should always be a sign placed before the number when using signed formats. .It Sq \&\ \& -A space specifying that a blank should be left before a positive number -for a signed format. A `+' overrides a space if both are used. +A space specifies that a blank should be left before a positive number +for a signed format. A +.Dq + +overrides a space if both are used. .It Cm \&0 -A zero `0' character indicating that zero-padding should be used -rather than blank-padding. A `\-' overrides a `0' if both are used. +A zero character specifies that zero-padding should be used +rather than blank-padding. This flag is ignored if used with a precision +specifier and any of the +.Cm d , i , o , u , +or +.Cm x +.Pq Cm X +formats. A +.Dq \&- +overrides a +.Dq \&0 +if both are used. .El .It "Field Width:" An optional digit string specifying a @@ -176,8 +188,8 @@ has been given) to make up the field width (note that a leading zero is a flag, but an embedded zero is part of a field width). .It Precision: -An optional period, -.Sq Cm \&.\& , +An optional period +.Pq Sq \&. , followed by an optional digit string giving a .Em precision which specifies the number of digits to appear after the decimal point, @@ -194,7 +206,7 @@ .El .Pp A field width or precision may be -.Sq Cm \&* +.Dq \&* instead of a digit string. In this case an .Ar argument @@ -205,8 +217,12 @@ .It Cm diouXx The .Ar argument -is printed as a signed decimal (d or i), unsigned octal, unsigned decimal, -or unsigned hexadecimal (X or x), respectively. +is printed as a signed decimal +.Pq Cm d No or Cm i , +unsigned octal, unsigned decimal, +or unsigned hexadecimal +.Pq Cm x No or Cm X , +respectively. .It Cm f The .Ar argument @@ -230,7 +246,11 @@ is one digit before the decimal point and the number after is equal to the precision specification for the argument; when the precision is missing, 6 digits are produced. -An upper-case E is used for an `E' format. +An upper-case +.Dq E +is used for an +.Cm E +format. .It Cm gG The .Ar argument @@ -255,7 +275,9 @@ indicated by the precision specification is reached; however if the precision is 0 or missing, all characters in the string are printed. .It Cm \&% -Print a `%'; no argument is used. +Print a +.Dq \&% ; +no argument is used. .El .Pp In no case does a non-existent or small field width cause truncation of