[HELP] - Adding

Posted on Monday 23rd February 2009 at 03:14 PM
jambomb
jambomb's Avatar
Hi, i need to round up all the number of quantity for this thing im making,

People have cars and they have a quantity but how can I add up all the quantity together to make 1 number if you understand?

Ty
Posted on Monday 23rd February 2009 at 11:21 PM
ShadowMage
ShadowMage's Avatar
https://php.net/ceil
https://php.net/floor

Soo... if its decimal numbers..
Code
$totalNumber = floor($n1 + $n2 + $n3);
//OR
$totalNumber = ceil($n1 + $n2 + $n3);


If not just;
Code
$totalNumber = ($n1+$n2+$n3);
failure i sense
Posted on Tuesday 24th February 2009 at 10:29 AM
jambomb
jambomb's Avatar
What im trying to do is the players have a garage of cars and each car has a quantity default is 1, what i need is to calculate each quantity untill it reaches the garage max which is different for each garage and im trying to make it so when the total amount of quantity reaches the garage max it will say your garage is full.

xD

Thanks
Login or register to respond to this forum topic.