I imagine this is a n00b mistake, but the problem I am having is that the first function(stratQ ual) is evaluating to "No" despite the argument being passed to it being greater than 80.00. The second function evalutes correctly. I have tried re-writing the first function as a switch case, but with the same results. I have also tried setting $stratQual = $faPercToGoal within the function and the function returns and displays the correct value for $faPercToGoal.
The syntax for the two appears identical, so I can't understand why they are not evaluating in the same manner. Can someone please shed some light on what I am doing wrong here?
Here is how I process each argument prior to sending to the function:
[code=php]
$faPercToGoal = number_format(( ($maxValFin/$faSValFin) * 100), 2);
$stratQual = stratQual($faPe rcToGoal);
$qamPercGoal = number_format(( ($qamActTot/$qamGoalSum)*10 0), 2);
$qamQual = qamQual($qamPer cGoal);
//Determine if agent strategic value percent/goal meets requirements
function stratQual($faPe rcToGoal)
{
if ($faPercToGoal >= '80.00')
{
$stratQual = "Yes";
}
else
{
$stratQual = "No";
}
return $stratQual;
}
//Determine if agent quality percent/goal meets requirements
function qamQual($qamPer cGoal)
{
if ($qamPercGoal >= '95.00')
{
$qamQual = "Yes";
}
else
{
$qamQual = "No";
}
return $qamQual;
}
[/code]
The syntax for the two appears identical, so I can't understand why they are not evaluating in the same manner. Can someone please shed some light on what I am doing wrong here?
Here is how I process each argument prior to sending to the function:
[code=php]
$faPercToGoal = number_format(( ($maxValFin/$faSValFin) * 100), 2);
$stratQual = stratQual($faPe rcToGoal);
$qamPercGoal = number_format(( ($qamActTot/$qamGoalSum)*10 0), 2);
$qamQual = qamQual($qamPer cGoal);
//Determine if agent strategic value percent/goal meets requirements
function stratQual($faPe rcToGoal)
{
if ($faPercToGoal >= '80.00')
{
$stratQual = "Yes";
}
else
{
$stratQual = "No";
}
return $stratQual;
}
//Determine if agent quality percent/goal meets requirements
function qamQual($qamPer cGoal)
{
if ($qamPercGoal >= '95.00')
{
$qamQual = "Yes";
}
else
{
$qamQual = "No";
}
return $qamQual;
}
[/code]
Comment