Posted By

andreiabohner on 12/27/09


Tagged

calculate percent


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

BrianCoyDesign
joethermal


Calculate percent


 / Published in: PHP
 

  1. function percent($val1='', $val2=''){
  2. if(!empty($val1) && !empty($val2)){
  3. $res = round(($val1/$val2)*100,2);
  4. return $res;
  5. }
  6. return false;
  7. }

Report this snippet  

You need to login to post a comment.