View Full Version : Using /2 coming up with decimals?

01-26-2008, 07:12 PM
I have a problems. If I divide a number in half and it's not even, it gives me decimals. Like this

$points = 5;
$newpoints = $member["points"]/2;

Your new points are $newpoints

Which comes up as 2.5

I didn't write it the same way, but I am sure you understand. How can I get it to exclude decimals and round to the next number? So it would be a 2 or 3 ?

01-26-2008, 07:25 PM

01-26-2008, 07:27 PM
That link doesn't work

01-26-2008, 09:03 PM
Ok, common sense tell you that the link is to php.net. The site seems to be down.

So, once you are able to get to php.net, search for the round() function.

Or, try a mirror:

Or, let me just tell you: use round()

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum