mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-28 19:02:10 +01:00
# test the "error check" module from new tool git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@274782 c90b9560-bf6c-de11-be94-00142212c4b1
166 lines
4.1 KiB
XML
166 lines
4.1 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.20 $ -->
|
|
<!-- EN-Revision: 1.15 Maintainer: yannick Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
|
|
<refentry xml:id="function.round" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>round</refname>
|
|
<refpurpose>Arrondi un nombre à virgule flottante</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>float</type><methodname>round</methodname>
|
|
<methodparam><type>float</type><parameter>val</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>precision</parameter><initializer>0</initializer></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>mode</parameter><initializer>PHP_ROUND_HALF_UP</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Retourne la valeur arrondie de <parameter>val</parameter>
|
|
à la précision <parameter>precision</parameter> (nombre de
|
|
chiffres après la virgule). Le paramètre <parameter>precision</parameter>
|
|
peut être négatif ou &null; : c'est sa valeur par défaut.
|
|
</para>
|
|
<para>
|
|
<note>
|
|
<simpara>
|
|
PHP ne gère pas correctement les chaînes telles que
|
|
<literal>"12 300,2"</literal>, par défaut. Reportez-vous à
|
|
<link linkend="language.types.string.conversion">la conversion de
|
|
chaînes</link>.
|
|
</simpara>
|
|
</note>
|
|
</para>
|
|
<para>
|
|
<note>
|
|
<simpara>
|
|
Le paramètre <parameter>precision</parameter> a été introduit
|
|
en PHP 4.
|
|
</simpara>
|
|
</note>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>val</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
La valeur à arrondir
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>precision</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Le nombre optionnel de décimales à arrondir ; par défaut, 0
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>mode</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Une constante parmi <constant>PHP_ROUND_HALF_UP</constant>,
|
|
<constant>PHP_ROUND_HALF_DOWN</constant>,
|
|
<constant>PHP_ROUND_HALF_EVEN</constant>, ou
|
|
<constant>PHP_ROUND_HALF_ODD</constant>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
La valeur arrondie
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>round</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
echo round(3.4); // 3
|
|
echo round(3.5); // 4
|
|
echo round(3.6); // 4
|
|
echo round(3.6, 0); // 4
|
|
echo round(1.95583, 2); // 1.96
|
|
echo round(1241757, -3); // 1242000
|
|
echo round(5.045, 2); // 5.05
|
|
echo round(5.055, 2); // 5.06
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</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>
|
|
Le paramètre <parameter>mode</parameter> a été ajouté.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>ceil</function></member>
|
|
<member><function>floor</function></member>
|
|
<member><function>number_format</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
--> |