Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
791 connectés 

  FORUM HardWare.fr
  Programmation

  [php] division et arrondie

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

[php] division et arrondie

n°84831
herks
Posté le 29-12-2001 à 12:21:08  profilanswer
 

ben voila je debute en php et j'aimerai savoir comment on peut arrondir le resultat d'une division a 2 chiffres apres la virgule...
merci

mood
Publicité
Posté le 29-12-2001 à 12:21:08  profilanswer
 

n°84847
Sh@rdar
Ex-PhPéteur
Posté le 29-12-2001 à 13:07:54  profilanswer
 

cherche dans la doc à number_format()


---------------
La musique c'est comme la bouffe, tu te souviens du restaurant dans lequel t'as bien mangé 20 ans plus tôt, mais pas du sandwich d'il y a 5 minutes :o - Plugin pour winamp ©Harkonnen : http://harko.free.fr/soft
n°84848
Autruche
bla bla bla....
Posté le 29-12-2001 à 13:23:18  profilanswer
 

si c juste pour afficher alors tu peux faire
printf("%.02f",$variable);


---------------
Dezintoxikation
n°84854
gizmo
Posté le 29-12-2001 à 13:32:42  profilanswer
 

round($valeur,2);

n°84871
herks
Posté le 29-12-2001 à 17:09:46  profilanswer
 

c bon ca marche ...
merci!


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation

  [php] division et arrondie

 

Sujets relatifs
[POSTGRESQL] division[vb] comment récup la partie entière d'une division?
Plus de sujets relatifs à : [php] division et arrondie


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR