New to Php & needing function help.
Posted: Wed Apr 29, 2009 12:22 pm
I'm working on a program that calculates an employees overtime, but my overtime function isn't working! Any suggestions?
Code: Select all
function getWage($hourlyWage, $hoursWorked)
{
if ($hoursWorked <= 40)
return round(($hourlyWage * $hoursWorked), 2);
else
return round(($hourlyWage * 40) +
($hourlyWage * 1.5 * ($hoursWorked - 40)), 2);
}