Portal Poll Block not rounding
Posted: 29. November 2009 20:20
Your Portal Version: 1.0.4
Your phpBB Type: Standard phpBB3
MODs installed: No
Your knowledge: Beginner
Boardlink: http://www.gopherpucklive.com/forum/portal.php
What have you done before the problem was there?
This must be a bug because it has always been wrong.
What have you already tryed to solve the problem?
Nothing
Description and Message
Why doesn't the poll block on the portal page round up or down? It rounds when you go in to the specific poll thread, but it does not on the portal page.
If you go to my portal page you will see a poll about halfway down. As of this posting the poll had 53 votes. 43 for one option and 13 for the other. The percentages are 75% and 24%. Well that does not add up to 100%. When you view the thread in it's native area, it reads 75% & 25%.
The actual percentages on the portal page are not getting rounded up and down like they should be. So the 75% is actually 75.47% and should be rounded down to 75% and the 24% which is actually 24.52% should be rounded up to 25%. It appears the portal poll block is ignoring the decimal places and just displaying the whole number. Hence my poll is adding up to 99% instead of 100%.
It does sometimes get the percentages correct, but that is only when there are no decimal places. I have seen this bug going back quite a few versions and I am surprised that no one has ever noticed it.
Your phpBB Type: Standard phpBB3
MODs installed: No
Your knowledge: Beginner
Boardlink: http://www.gopherpucklive.com/forum/portal.php
What have you done before the problem was there?
This must be a bug because it has always been wrong.
What have you already tryed to solve the problem?
Nothing
Description and Message
Why doesn't the poll block on the portal page round up or down? It rounds when you go in to the specific poll thread, but it does not on the portal page.
If you go to my portal page you will see a poll about halfway down. As of this posting the poll had 53 votes. 43 for one option and 13 for the other. The percentages are 75% and 24%. Well that does not add up to 100%. When you view the thread in it's native area, it reads 75% & 25%.
The actual percentages on the portal page are not getting rounded up and down like they should be. So the 75% is actually 75.47% and should be rounded down to 75% and the 24% which is actually 24.52% should be rounded up to 25%. It appears the portal poll block is ignoring the decimal places and just displaying the whole number. Hence my poll is adding up to 99% instead of 100%.
It does sometimes get the percentages correct, but that is only when there are no decimal places. I have seen this bug going back quite a few versions and I am surprised that no one has ever noticed it.