Jump to content

should be a simple answer .....


cohan1279

Recommended Posts

Hi , I feel kinda dumb for asking this, but im lost. I just need to get the remaider for div.
example --  $divamount = floor($amount / 12); --- if $amount = 16 , is there a function i can use to get the remaining 4?  $remamount = ? ($amount / 12); ???
Ive looked thruogh a list of php functions over and over but havent seen anything. What im tring to do is split up a givin # in to 12 database table rows but i want to be able to put the remainder in the 12th one as well.

[code]if ($type == 't_armtrp')
  {
    $divamount = floor($amount / 12);
  if ($amount > 12) 
    {
   
   
$users[$type] += $amount; 
$users[armtrain1] += $divamount;
$users[armtrain2] += $divamount;
$users[armtrain3] += $divamount;
$users[armtrain4] += $divamount;
$users[armtrain5] += $divamount;
$users[armtrain6] += $divamount;
$users[armtrain7] += $divamount;
$users[armtrain8] += $divamount;
$users[armtrain9] += $divamount;
$users[armtrain10] += $divamount;
$users[armtrain11] += $divamount;
$users[armtrain12] += ($divamount + $remamount);
$canbuy[$type] -= $amount;
print commas($amount)." $uera[$type] have been sent to training for $".commas($cost).".<br>\n";
    }[/code]

please help........
Link to comment
https://forums.phpfreaks.com/topic/27579-should-be-a-simple-answer/
Share on other sites

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.