SommaireTelecharger la documentationChapitre suivantChapitre precedent  

  .: News :.: Edito :.: Scripts :.: Forum :.: Erreurs :.: Jobs :. 
 
Sommaire

Mathématiques

Introduction
Abs
Acos
acosh
Asin
asinh
Atan
Atan2
atanh
base_convert
BinDec
Ceil
Cos
cosh
DecBin
DecHex
DecOct
deg2rad
Exp
Floor
getrandmax
hexdec
lcg_value
Log
Log10
max
min
mt_rand
mt_srand
mt_getrandmax
number_format
OctDec
pi
pow
rad2deg
rand
round
Sin
sinh
Sqrt
srand
Tan
tanh

6.50.37 round

[ Exemples avec round ]   PHP 3, PHP 4 >= 4.0.0

Description

float round(float val ,[int precision ])

round retourne la valeur arrondie de val à la précision precision (nombre de chiffres après la virgule). Le paramètre precision peut être négatif ou null (sa valeur par défaut).

Attention

PHP ne gère par correctement les chaînes telles que "12 300,2", par défaut. Reportez-vous à la conversion de chaînes.


<?php
  $foo 
round3.4 );   // $foo == 3.0
  
$foo round3.5 );   // $foo == 4.0
  
$foo round3.6 );   // $foo == 4.0
?>

Note

Le paramètre precision est disponible uniquement en PHP 4.

Voir aussi ceil et floor.


Chapitre précédentChapitre suivantAccueil nexen.net