BSD 4_3 release
[unix-history] / usr / man / man3 / printf.3s
index 8efff87..182581b 100644 (file)
@@ -1,4 +1,7 @@
-.TH PRINTF 3S "1 April 1981"
+.\"    @(#)printf.3s   6.3 (Berkeley) 6/5/86
+.\"
+.TH PRINTF 3S "June 5, 1986"
+.AT 3
 .SH NAME
 printf, fprintf, sprintf \- formatted output conversion
 .SH SYNOPSIS
 .SH NAME
 printf, fprintf, sprintf \- formatted output conversion
 .SH SYNOPSIS
@@ -66,38 +69,15 @@ of the next successive
 .PP
 Each conversion specification is introduced by the character
 .BR % .
 .PP
 Each conversion specification is introduced by the character
 .BR % .
-Following the
-.BR % ,
-there may be
+The remainder of the conversion specification includes
+in the following order
 .TP
 .B \(bu
 .TP
 .B \(bu
-an optional minus sign `\-' which specifies
-.I "left adjustment"
-of the converted value in the indicated field;
-.TP
-.B \(bu
-an optional digit string specifying a
-.I "field width;"
-if the converted value has fewer characters than the field width
-it will be blank-padded on the left (or right,
-if the left-adjustment indicator has been given) to make up the field width;
-if the field width begins with a zero,
-zero-padding will be done instead of blank-padding;
-.TP
-.B \(bu
-an optional period
-.RB ` . '
-which serves to separate the field width from the next digit string;
-.TP
-.B \(bu
-an optional digit string specifying a
-.I precision
-which specifies the number of digits to appear after the
-decimal point, for e- and f-conversion, or the maximum number of characters
-to be printed from a string;
+Zero or more of following flags:
+.RS
 .TP
 .B \(bu
 .TP
 .B \(bu
-an optional `#' character
+a `#' character
 specifying that the value should be converted to an ``alternate form''.
 For 
 .BR c ,
 specifying that the value should be converted to an ``alternate form''.
 For 
 .BR c ,
@@ -129,6 +109,41 @@ conversions, trailing zeros are not removed from the result as they
 would otherwise be.
 .TP
 .B \(bu
 would otherwise be.
 .TP
 .B \(bu
+a minus sign `\-' which specifies
+.I "left adjustment"
+of the converted value in the indicated field;
+.TP
+.B \(bu
+a `+' character specifying that there should always be
+a sign placed before the number when using signed conversions.
+.TP
+.B \(bu
+a space specifying that a blank should be left before a positive number
+during a signed conversion.  A `+' overrides a space if both are used.
+.RE
+.TP
+.B \(bu
+an optional digit string specifying a
+.I "field width;"
+if the converted value has fewer characters than the field width
+it will be blank-padded on the left (or right,
+if the left-adjustment indicator has been given) to make up the field width;
+if the field width begins with a zero,
+zero-padding will be done instead of blank-padding;
+.TP
+.B \(bu
+an optional period
+.RB ` . '
+which serves to separate the field width from the next digit string;
+.TP
+.B \(bu
+an optional digit string specifying a
+.I precision
+which specifies the number of digits to appear after the
+decimal point, for e- and f-conversion, or the maximum number of characters
+to be printed from a string;
+.TP
+.B \(bu
 the character
 .B l
 specifying that a following
 the character
 .B l
 specifying that a following