I need some help writing the following lines of code into a simple
function. I'd like to be able to create a function to do the
calculation, then feed the $a, $b, or $c variable into it.
Thanks,
J
<?php $a = $kerryvotes/$votes;
$kpercentage = $a * 100;
$kpercent = round($kpercentage, 0);
?>
<?php $b = $bushvotes/$votes;
$bpercentage = $b * 100;
$bpercent = round($bpercentage, 0);
?>
<?php $c = $nadervotes/$votes;
$npercentage = $c * 100;
$npercent = round($npercentage, 0);
?>