Jump to content

Multiplying Variables


topflight

Recommended Posts

I have 2 variables a

nd they are not multiplying. here is what my code looks like:

if($rank =='CATI'){$hourly='1,500';}elseif($rank == 'CATII'){$hourly == '2,500';}elseif($rank == 'CATIII'){$hourly == '4,500';}elseif($rank == 'CATIV'){$hourly ='8,000';}elseif($rank =='CATV'){$hourly ='10,000';}


$pmoney = $rr["money"];

$money = "$hourly" * "$dur";
$finalcut = "$money" + "$pmoney";

 

Also the $pmoney is part of a mysql_fetch_assoc but the problem I am having is that $money is not multiplying please help.

 

Thanks in advanced

Link to comment
https://forums.phpfreaks.com/topic/191926-multiplying-variables/
Share on other sites

My current code looks like this

if($rank =='CATI'){$hourly='1500';}elseif($rank == 'CATII'){$hourly == '2500';}elseif($rank == 'CATIII'){$hourly == '4500';}elseif($rank == 'CATIV'){$hourly ='8000';}elseif($rank =='CATV'){$hourly ='10000';}

$money = $hourly * $dur;
$finalcut = $money + $pmoney;

 

 

And it is still not doing the math correctly I am getting 0 for the $finalcut

 

 

And just and FYI the dur is a decimal number like 2.5

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.