PHP : percent an INT


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. // cross product
  2. function neo_percent($total, $rapport){
  3. if($total > 0){
  4. $percent = ( 100 * $rapport) / $total ;
  5. }else{
  6. $percent = 0;
  7. }
  8. return round($percent,2);
  9. }

URL: http://www.giacomel.fr

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.