cvs: phpdoc-fr /reference/strings/functions sprintf.xml
| From: | Yannick TORRES | Date: | Sat, 29 May 2004 10:56:57 +0000 |
| Subject: | cvs: phpdoc-fr /reference/strings/functions sprintf.xml | ||
| Groups: | php.doc.fr | ||
| Request: | Send a blank email to doc-fr+get-2783@lists.php.net to get a copy of this message | ||
yannick Sat May 29 06:56:57 2004 EDT
Modified files:
/phpdoc-fr/reference/strings/functions sprintf.xml
Log:
synch with EN Revision
http://cvs.php.net/diff.php/phpdoc-fr/reference/strings/functions/sprintf.xml?r1=1.8&r2=1.9&ty=u
Index: phpdoc-fr/reference/strings/functions/sprintf.xml
diff -u phpdoc-fr/reference/strings/functions/sprintf.xml:1.8
phpdoc-fr/reference/strings/functions/sprintf.xml:1.9
--- phpdoc-fr/reference/strings/functions/sprintf.xml:1.8 Mon May 24 18:08:47 2004
+++ phpdoc-fr/reference/strings/functions/sprintf.xml Sat May 29 06:56:57 2004
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.8 $ -->
-<!-- EN-Revision: 1.8 Maintainer: yannick Status: ready -->
+<!-- $Revision: 1.9 $ -->
+<!-- EN-Revision: 1.9 Maintainer: yannick Status: ready -->
<refentry id="function.sprintf">
<refnamediv>
<refname>sprintf</refname>
@@ -89,6 +89,10 @@
et présenté comme un nombre décimal signé.
</member>
<member>
+ <literal>e</literal> - l'argument est traité comme une notation
scientifique
+ (e.g. 1.2e+2).
+ </member>
+ <member>
<literal>u</literal> - l'argument est traité comme un entier,
et présenté comme un nombre décimal non signé.
</member>
@@ -170,9 +174,9 @@
<programlisting role="php">
<![CDATA[
<?php
- $format = "Le %2\$s a %1\$d singes.
+$format = "Le %2\$s a %1\$d singes.
C'est un beau %2\$s, avec %1\$d signes.";
- printf($format, $num, $location);
+printf($format, $num, $location);
?>
]]>
</programlisting>
@@ -211,6 +215,18 @@
// echo $money va afficher "123.1";
$formatted = sprintf("%01.2f", $money);
// echo $formatted va afficher "123.10"
+?>
+]]>
+ </programlisting>
+ </example>
+ <example>
+ <title><function>sprintf</function>: notation scientifique</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$number = 362525200;
+
+echo sprintf("%.3e", $number); // affichera 3.63e+8
?>
]]>
</programlisting>