round() mode parameter

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@273644 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Jakub Vrana 2009-01-16 15:37:00 +00:00
parent 0ef9a59224
commit 945112faad
2 changed files with 57 additions and 2 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<appendix xml:id="math.constants" xmlns="http://docbook.org/ns/docbook">
&reftitle.constants;
&extension.constants.core;
@ -100,6 +100,26 @@
<entry>0.57721566490153286061</entry>
<entry>Euler constant [5.2.0]</entry>
</row>
<row>
<entry>PHP_ROUND_HALF_UP</entry>
<entry>1</entry>
<entry>Round halves up [5.3.0]</entry>
</row>
<row>
<entry>PHP_ROUND_HALF_DOWN</entry>
<entry>2</entry>
<entry>Round halves down [5.3.0]</entry>
</row>
<row>
<entry>PHP_ROUND_HALF_EVEN</entry>
<entry>3</entry>
<entry>Round halves to even numbers [5.3.0]</entry>
</row>
<row>
<entry>PHP_ROUND_HALF_ODD</entry>
<entry>4</entry>
<entry>Round halves to odd numbers [5.3.0]</entry>
</row>
</tbody>
</tgroup>
</table>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.13 $ -->
<!-- $Revision: 1.14 $ -->
<refentry xml:id="function.round" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>round</refname>
@ -11,6 +11,7 @@
<type>float</type><methodname>round</methodname>
<methodparam><type>float</type><parameter>val</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>precision</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>mode</parameter><initializer>PHP_ROUND_HALF_UP</initializer></methodparam>
</methodsynopsis>
<para>
Returns the rounded value of <parameter>val</parameter> to
@ -72,6 +73,17 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>mode</parameter></term>
<listitem>
<para>
One of <constant>PHP_ROUND_HALF_UP</constant>,
<constant>PHP_ROUND_HALF_DOWN</constant>,
<constant>PHP_ROUND_HALF_EVEN</constant>, or
<constant>PHP_ROUND_HALF_ODD</constant>.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
@ -103,6 +115,29 @@ echo round(5.055, 2); // 5.06
</example>
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>5.3.0</entry>
<entry>
The <parameter>mode</parameter> parameter was introduced.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>