Jump to content

im doing something wrong....


SparrowBD

Recommended Posts

ok, so im trying to determine the net income only based off of gross income - fuel price per pirep. the code i have looks like this:

$gross = FinanceData::FormatMoney($pirep->load * $pirep->price);
$fuel = FinanceData::FormatMoney($pirep->fuelused * $pirep->fuelunitcost);
$netincome = $gross - $fuel;
echo $netincome;

the value it returns is 0, no matter what.

if i echo each gross and fuel separably it shows the numbers properly.

What exactly am i doing wrong here?

  • Like 1
Link to comment
Share on other sites

yw

it actually ended up not giving me the proper result. i modifified it to the following to get it to work:

$gross = $pirep->load * $pirep->price;
$fuelused = $pirep->fuelused;
$fuelcost = $pirep->fuelunitcost;

$fuel = $fuelused * $fuelcost;
$netincome = $gross - $fuel;

echo FinanceData::FormatMoney($netincome);

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...