SparrowBD Posted September 18, 2012 Report Share Posted September 18, 2012 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? 1 Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted September 18, 2012 Moderators Report Share Posted September 18, 2012 Change it to this: $gross = $pirep->load * $pirep->price; $fuel = $pirep->fuelused * $pirep-fuelunitcost; $netincome = $gross - $fuel; echo FinanceData::FormatMony($netincome); Quote Link to comment Share on other sites More sharing options...
SparrowBD Posted September 18, 2012 Author Report Share Posted September 18, 2012 Change it to this: $gross = $pirep->load * $pirep->price; $fuel = $pirep->fuelused * $pirep-fuelunitcost; $netincome = $gross - $fuel; echo FinanceData::FormatMony($netincome); ty Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted September 18, 2012 Moderators Report Share Posted September 18, 2012 yw Quote Link to comment Share on other sites More sharing options...
SparrowBD Posted September 18, 2012 Author Report Share Posted September 18, 2012 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); Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted September 18, 2012 Moderators Report Share Posted September 18, 2012 So is it working? Quote Link to comment Share on other sites More sharing options...
Guest lorathon Posted September 18, 2012 Report Share Posted September 18, 2012 parkho's original code has an error $fuel = $pirep->fuelused * $pirep-fuelunitcost; Should be $fuel = $pirep->fuelused * $pirep->fuelunitcost; > is missing Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted September 18, 2012 Moderators Report Share Posted September 18, 2012 oh I see that now. I thought maybe the "FormatMoney()" function should be used at the end and that's why there were no results. Thanks for pointing that out. Salamaty Quote Link to comment Share on other sites More sharing options...
Guest lorathon Posted September 18, 2012 Report Share Posted September 18, 2012 np Quote Link to comment Share on other sites More sharing options...
SparrowBD Posted September 19, 2012 Author Report Share Posted September 19, 2012 yep got it working thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.