mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 08:58:56 +00:00
Specify that conversion specifiers in sprintf() & friends start with '%'.
Fixed a typo. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@32505 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
7fdd4c38f5
commit
cbc1550a42
1 changed files with 66 additions and 65 deletions
|
@ -1468,7 +1468,7 @@ soundex ("Lukasiewicz") == soundex ("Lissajous") == 'L222';
|
|||
<parameter>format</parameter>.
|
||||
</simpara>
|
||||
<simpara>
|
||||
The format string is composed by zero or more directives:
|
||||
The format string is composed of zero or more directives:
|
||||
ordinary characters (excluding <literal>%</literal>) that are
|
||||
copied directly to the result, and <emphasis>conversion
|
||||
specifications</emphasis>, each of which results in fetching its
|
||||
|
@ -1476,89 +1476,90 @@ soundex ("Lukasiewicz") == soundex ("Lissajous") == 'L222';
|
|||
and <function>printf</function>.
|
||||
</simpara>
|
||||
<para>
|
||||
Each conversion specification consists of these elements, in
|
||||
order:
|
||||
Each conversion specification consists of a percent sign
|
||||
(<literal>%</literal>), followed by one or more of these
|
||||
elements, in order:
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<simpara>
|
||||
An optional <emphasis>padding specifier</emphasis> that says
|
||||
what character will be used for padding the results to the
|
||||
right string size. This may be a space character or a
|
||||
<literal>0</literal> (zero character). The default is to pad
|
||||
with spaces. An alternate padding character can be specified
|
||||
by prefixing it with a single quote (<literal>'</literal>).
|
||||
See the examples below.
|
||||
An optional <emphasis>padding specifier</emphasis> that says
|
||||
what character will be used for padding the results to the
|
||||
right string size. This may be a space character or a
|
||||
<literal>0</literal> (zero character). The default is to pad
|
||||
with spaces. An alternate padding character can be specified
|
||||
by prefixing it with a single quote (<literal>'</literal>).
|
||||
See the examples below.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
An optional <emphasis>alignment specifier</emphasis> that says
|
||||
if the result should be left-justified or right-justified.
|
||||
The default is right-justified; a <literal>-</literal>
|
||||
character here will make it left-justified.
|
||||
An optional <emphasis>alignment specifier</emphasis> that says
|
||||
if the result should be left-justified or right-justified.
|
||||
The default is right-justified; a <literal>-</literal>
|
||||
character here will make it left-justified.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
An optional number, a <emphasis>width specifier</emphasis>
|
||||
that says how many characters (minimum) this conversion should
|
||||
result in.
|
||||
An optional number, a <emphasis>width specifier</emphasis>
|
||||
that says how many characters (minimum) this conversion should
|
||||
result in.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
An optional <emphasis>precision specifier</emphasis> that says
|
||||
how many decimal digits should be displayed for floating-point
|
||||
numbers. This option has no effect for other types than
|
||||
double. (Another function useful for formatting numbers is
|
||||
<function>number_format</function>.)
|
||||
An optional <emphasis>precision specifier</emphasis> that says
|
||||
how many decimal digits should be displayed for floating-point
|
||||
numbers. This option has no effect for other types than
|
||||
double. (Another function useful for formatting numbers is
|
||||
<function>number_format</function>.)
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
A <emphasis>type specifier</emphasis> that says what type the
|
||||
argument data should be treated as. Possible types:
|
||||
<simplelist>
|
||||
<member>
|
||||
<literal>%</literal> - a literal percent character. No
|
||||
argument is required.
|
||||
</member>
|
||||
<member>
|
||||
<literal>b</literal> - the argument is treated as an
|
||||
integer, and presented as a binary number.
|
||||
</member>
|
||||
<member>
|
||||
<literal>c</literal> - the argument is treated as an
|
||||
integer, and presented as the character with that ASCII
|
||||
value.
|
||||
</member>
|
||||
<member>
|
||||
<literal>d</literal> - the argument is treated as an
|
||||
integer, and presented as a decimal number.
|
||||
</member>
|
||||
<member>
|
||||
<literal>f</literal> - the argument is treated as a double,
|
||||
and presented as a floating-point number.
|
||||
</member>
|
||||
<member>
|
||||
<literal>o</literal> - the argument is treated as an
|
||||
integer, and presented as an octal number.
|
||||
</member>
|
||||
<member>
|
||||
<literal>s</literal> - the argument is treated as and
|
||||
presented as a string.
|
||||
</member>
|
||||
<member>
|
||||
<literal>x</literal> - the argument is treated as an integer
|
||||
and presented as a hexadecimal number (with lowercase
|
||||
letters).
|
||||
</member>
|
||||
<member>
|
||||
<literal>X</literal> - the argument is treated as an integer
|
||||
and presented as a hexadecimal number (with uppercase
|
||||
letters).
|
||||
</member>
|
||||
</simplelist>
|
||||
A <emphasis>type specifier</emphasis> that says what type the
|
||||
argument data should be treated as. Possible types:
|
||||
<simplelist>
|
||||
<member>
|
||||
<literal>%</literal> - a literal percent character. No
|
||||
argument is required.
|
||||
</member>
|
||||
<member>
|
||||
<literal>b</literal> - the argument is treated as an
|
||||
integer, and presented as a binary number.
|
||||
</member>
|
||||
<member>
|
||||
<literal>c</literal> - the argument is treated as an
|
||||
integer, and presented as the character with that ASCII
|
||||
value.
|
||||
</member>
|
||||
<member>
|
||||
<literal>d</literal> - the argument is treated as an
|
||||
integer, and presented as a decimal number.
|
||||
</member>
|
||||
<member>
|
||||
<literal>f</literal> - the argument is treated as a double,
|
||||
and presented as a floating-point number.
|
||||
</member>
|
||||
<member>
|
||||
<literal>o</literal> - the argument is treated as an
|
||||
integer, and presented as an octal number.
|
||||
</member>
|
||||
<member>
|
||||
<literal>s</literal> - the argument is treated as and
|
||||
presented as a string.
|
||||
</member>
|
||||
<member>
|
||||
<literal>x</literal> - the argument is treated as an integer
|
||||
and presented as a hexadecimal number (with lowercase
|
||||
letters).
|
||||
</member>
|
||||
<member>
|
||||
<literal>X</literal> - the argument is treated as an integer
|
||||
and presented as a hexadecimal number (with uppercase
|
||||
letters).
|
||||
</member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
|
|
Loading…
Reference in a new issue