X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/0f4556f12c8f75078501c9d1338ae7648a97f975..95f51977ddc18faa2e212f30c00a39540b39f325:/usr/man/man3/printf.3s diff --git a/usr/man/man3/printf.3s b/usr/man/man3/printf.3s index 8efff87011..182581bcd5 100644 --- a/usr/man/man3/printf.3s +++ b/usr/man/man3/printf.3s @@ -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 @@ -66,38 +69,15 @@ of the next successive .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 -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 -an optional `#' character +a `#' character 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 +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