Quote:
Originally Posted by Boofo
Try this for the percentage:
PHP Code:
if(activityrate > 100)
{
activityrate = vb_number_format(($activemembers / $numbermembers) * 100 / 1000, 2 ) . '%';
}
else
{
activityrate = vb_number_format(($activemembers / $numbermembers) * 100, 2) . '%';
}
|
Hmm. That gave the percentage a thousand comma (-37,700%) but didn't seem to solve anything.
The thing is I doubt the problem is in the percentage calculation. As you can see the Active Members number is screwed up, while the Inactive one isn't. Since the Active members calculation is TotalMembers - InactiveMembers it could be related to the Total Member variable.
Thing is though if I put $numbermembers ONLY it works right (displays 1000) while if I just put $nonposters it also works right (displays 378). BUT when you put them together in a calculation it treats the $numbermembers variable is only being 1. Not 1000. So 1-378 is -377 which is weird.
I've tried other random calculations and all the time it treats that variable as 1 and not 1000, but if I stick it there on it's own it displays 1000. This is just so totally random.
Anything else? Since $numbermembers is a normal variable on the forums, not one added by the hack it makes things worse... :-\