danbeck Tue Jun 26 22:42:17 2001 EDT
Modified files:
/phpdoc/en/functions math.xml
Log:
number_format:
- added optional tags to optional parameters
- tweaked and added more examples
- moved example description under example block
- added "See also:" section
- removed several manual annotations that were
no longer needed because of these changes
Index: phpdoc/en/functions/math.xml
diff -u phpdoc/en/functions/math.xml:1.31 phpdoc/en/functions/math.xml:1.32
--- phpdoc/en/functions/math.xml:1.31 Sat Jun 23 22:10:51 2001
+++ phpdoc/en/functions/math.xml Tue Jun 26 22:42:17 2001
@@ -832,9 +832,9 @@
<funcprototype>
<funcdef>string <function>number_format</function></funcdef>
<paramdef>float <parameter>number</parameter></paramdef>
- <paramdef>int <parameter>decimals</parameter></paramdef>
- <paramdef>string <parameter>dec_point</parameter></paramdef>
- <paramdef>string <parameter>thousands_sep</parameter></paramdef>
+ <paramdef>int <parameter><optional>decimals</optional></parameter></paramdef>
+ <paramdef>string
+<parameter><optional>dec_point</optional></parameter></paramdef>
+ <paramdef>string
+<parameter><optional>thousands_sep</optional></parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
@@ -860,23 +860,44 @@
a comma (",") between every group of thousands.
</para>
<para>
- For instance, French notation usually use two decimals,
- comma (',') as decimal separator, and space (' ') as
- thousand separator. This is achieved with this line :
- <informalexample>
+ <example>
+ <title><function>number_format</function> Example</title>
+ <para>
+ For instance, French notation usually use two decimals,
+ comma (',') as decimal separator, and space (' ') as
+ thousand separator. This is achieved with this line :
+ </para>
<programlisting role="php">
<?php
- $nombre = 1234.56;
- // english notation (default)
- $english_format_number = number_format($nombre);
- // 1,234.56
- // French notation
- $nombre_format_francais = number_format($nombre, 2, ',', ' ');
- // 1 234,56
+
+ $number = 1234.56;
+
+ // english notation (default)
+ $english_format_number = number_format($number);
+ // 1,234.56
+
+ // French notation
+ $nombre_format_francais = number_format($number, 2, ',', ' ');
+ // 1 234,56
+
+
+ $number = 1234.5678;
+
+ // english notation without thousands seperator
+ $english_format_number = number_format($number, 2, '.', '');
+ // 1234.56
+
?>
</programlisting>
- </informalexample>
+ </example>
</para>
+ <note>
+ <para>
+ See also: <function>sprintf</function>,
+ <function>printf</function>, <function>sscanf</function> and
+ <function>fprintf</function>.
+ </para>
+ </note>
</refsect1>
</refentry>