PDA

View Full Version : Woops Again


xxclixxx
04-08-2008, 04:48 PM
Hey All

Ok, so when I reduced the surfing bonus to 5% for 150 and 175 surfing, I actually RAISED it to 50%.

I began tracking in detail where all credits are being earned, and I noticed a user had a 73% surfing bonus. I was shocked, as everyone else had a 23% bonus. But after checking the code carefully, I realized it changed when less were surfing. Rather than ".05" in the code there was a ".5".

So yet again, I had the bonuses all messed up. This isn't the first time I had the decimal off! So temporary fix, I've added very large comments to the code to remind me to double check. I'll probably come up with a better way in the future that does the decimals for me.

So there ya go

Tim

sflewis
04-08-2008, 11:22 PM
Well, thanks for the extra credits, even though that wasn't what you wanted.

charitylinks
04-09-2008, 03:11 AM
Too bad I missed that :)

lajab5
04-09-2008, 05:14 AM
me too. I been at 23%.......oh well.

inge
04-09-2008, 07:02 AM
Tip for you Tim:
Instead of using ratios or decimals I specify some numbers in percent in my scripts, and let the script do /100. A lot easier to handle, and less prone to error.

pericles
04-09-2008, 09:13 AM
Actually I caught it when there were 180 surfers last weekend. I think I caught about 300 extra free credits because of the error. But thanks again Tim!

mysticblu1
04-09-2008, 01:02 PM
I also lost out. But rather earn it the right way! ;)

nsant46
04-09-2008, 03:30 PM
Hi Tim.
I was thinking the % were too low...
Noemi

bobigean
04-10-2008, 04:54 AM
Dang, I missed this...LOL This is kind of funny to me, because I make these kind of mistakes. It shows we are human.

drkelp
04-10-2008, 06:18 AM
hi tim

its always good to comment code for later reference... i learned that from years of code reviews. good programmers do good commenting.