Files
doc-fr/reference/math/functions/round.xml
T
Yannick Torres 49756c07d0 sync with EN
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@164141 c90b9560-bf6c-de11-be94-00142212c4b1
2004-07-23 21:51:00 +00:00

87 lines
2.3 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.9 $ -->
<!-- EN-Revision: 1.9 Maintainer: yannick Status: ready -->
<refentry id="function.round">
<refnamediv>
<refname>round</refname>
<refpurpose>Arrondi</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>float</type><methodname>round</methodname>
<methodparam><type>float</type><parameter>val</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>precision</parameter></methodparam>
</methodsynopsis>
<para>
<function>round</function> 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 (sa valeur par défaut).
</para>
<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>
<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 depuis &php; 4.
</simpara>
</note>
</para>
<simpara>
Voir aussi
<function>ceil</function>,
<function>floor</function> et
<function>number_format</function>.
</simpara>
</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
-->