...

View Full Version : Formula Issue



Ndogg
02-27-2010, 10:21 PM
Why does this output 0?


//Original:
$buildtimediv[$num] = ($post*$btimes[$troop[$num]])*(($barlvl*2)/100);
//Make it Easier For You
$buildtimediv[$num] = (1*1018)*((2*2)/100);

(1*1018) = Outputs correct number
*((2*2)/100) = Idk what happened, it always makes everything 0

Len Whistler
02-27-2010, 11:09 PM
(1*1018)*((2*2)/100)

1018 * (4/100)

1018 * 0.04 = 40.72





--------------------

Ndogg
02-27-2010, 11:13 PM
Ya, but it comes out as 0 :/
it must be something wrong with the $barlvl

Len Whistler
02-27-2010, 11:14 PM
I would echo all variables - such as $barlvl - to check the values.




------------



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum