Forgot Password / Register
Site Statistics
Total Members: 520
Total Tutorials: 242
Newsest User: 8884244477
Todays Unique Hits: 761
0 Users 6 Guests Online
Forum Index » PHP + MySQL » [HELP] - Adding
Posted on Monday 23rd February 2009 at 03:14 PM
jambomb
templates/default/images/noavatar.png's Avatar
Junior Member
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
templates/default/images/noavatar.png's Avatar
Senior Member
http://php.net/ceil
http://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);
Posted on Tuesday 24th February 200 at 10:29 AM
jambomb
templates/default/images/noavatar.png's Avatar
Junior Member
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