version 1.6, 1998/11/30 01:48:02 |
version 1.7, 1999/06/05 01:21:37 |
|
|
.Nm printf |
.Nm printf |
.Nd formatted output |
.Nd formatted output |
.Sh SYNOPSIS |
.Sh SYNOPSIS |
.Nm printf |
.Nm printf |
.Ar format |
.Ar format |
.Op Ar arguments ... |
.Op Ar arguments ... |
.Sh DESCRIPTION |
.Sh DESCRIPTION |
|
|
.It |
.It |
A leading plus or minus sign is allowed. |
A leading plus or minus sign is allowed. |
.It |
.It |
If the leading character is a single or double quote, the value is the |
If the leading character is a single or double quote, the value is the |
.Tn ASCII |
.Tn ASCII |
code of the next character. |
code of the next character. |
.El |
.El |
|
|
Any extra format specifications are evaluated with zero or the null |
Any extra format specifications are evaluated with zero or the null |
string. |
string. |
.Pp |
.Pp |
Character escape sequences are in backslash notation as defined in |
Character escape sequences are in backslash notation as defined in |
.St -ansiC . |
.St -ansiC . |
The characters and their meanings |
The characters and their meanings |
are as follows: |
are as follows: |
|
|
Write a <single quote> character. |
Write a <single quote> character. |
.It Cm \e\e |
.It Cm \e\e |
Write a backslash character. |
Write a backslash character. |
.It Cm \e Ns Ar num |
.It Cm \e Ns Ar num |
Write an 8-bit character whose |
Write an 8-bit character whose |
.Tn ASCII |
.Tn ASCII |
value is the 1-, 2-, or 3-digit |
value is the 1-, 2-, or 3-digit |
|
|
which specifies the number of digits to appear after the decimal point, |
which specifies the number of digits to appear after the decimal point, |
for |
for |
.Cm e |
.Cm e |
and |
and |
.Cm f |
.Cm f |
formats, or the maximum number of characters to be printed |
formats, or the maximum number of characters to be printed |
from a string; if the digit string is missing, the precision is treated |
from a string; if the digit string is missing, the precision is treated |
|
|
.It Cm f |
.It Cm f |
The |
The |
.Ar argument |
.Ar argument |
is printed in the style |
is printed in the style |
.Sm off |
.Sm off |
.Pf [\-]ddd Cm \&. No ddd |
.Pf [\-]ddd Cm \&. No ddd |
.Sm on |
.Sm on |
|
|
.It Cm eE |
.It Cm eE |
The |
The |
.Ar argument |
.Ar argument |
is printed in the style |
is printed in the style |
.Sm off |
.Sm off |
.Pf [\-]d Cm \&. No ddd Cm e No \\*(Pmdd |
.Pf [\-]d Cm \&. No ddd Cm e No \\*(Pmdd |
.Sm on |
.Sm on |
|
|
.Sh STANDARDS |
.Sh STANDARDS |
The |
The |
.Nm printf |
.Nm printf |
utility conforms to |
utility conforms to |
.St -p1003.2-92 . |
.St -p1003.2-92 . |
.Sh BUGS |
.Sh BUGS |
Since arguments are translated from |
Since arguments are translated from |