mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
fix #28555: missing the 'e' specifier
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@159916 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
a5b59e7725
commit
437372647f
1 changed files with 17 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.sprintf">
|
||||
<refnamediv>
|
||||
|
@ -87,6 +87,10 @@
|
|||
<literal>d</literal> - the argument is treated as an
|
||||
integer, and presented as a (signed) decimal number.
|
||||
</member>
|
||||
<member>
|
||||
<literal>e</literal> - the argument is treated as scientific
|
||||
notation (e.g. 1.2e+2).
|
||||
</member>
|
||||
<member>
|
||||
<literal>u</literal> - the argument is treated as an
|
||||
integer, and presented as an unsigned decimal number.
|
||||
|
@ -210,6 +214,18 @@ $money = $money1 + $money2;
|
|||
$formatted = sprintf("%01.2f", $money);
|
||||
// echo $formatted will output "123.10"
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title><function>sprintf</function>: scientific notation</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$number = 362525200;
|
||||
|
||||
echo sprintf("%.3e", $number); // outputs 3.63e+8
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
|
Loading…
Reference in a new issue