Page 1 of 1

why isnt this value rounding off?

Posted: Thu Dec 07, 2006 10:37 pm
by Mythic Fr0st
Im trying to round a value off

this is my code

$_SESSION['strdmg']==rand(0, $_SESSION['strdmg'] * 2);

(above generates a random number between 0 & strdmg * 2, which btw is always 1.8)
(below is suppost to round it off, so it'd be 2.0 (i cant have decimal damage in my game, nor do I want it))

$_SESSION['strdmg']==round($_SESSION['strdmg']);

any idea's o_O

Posted: Thu Dec 07, 2006 10:41 pm
by feyd
You're mixing comparison operators and assignment operators again...

= is assignment (set the left operand to the right operand)
== is equality (the left operand's value is the same as the right operand's)
=== is identity (the types are the same and values are the same)

lol

Posted: Thu Dec 07, 2006 10:43 pm
by Mythic Fr0st
ah thanks, -.- im tired and very brain fogged today