NATION

PASSWORD

[BUG] Pie charts rounding errors?

Bug reports, general help, ideas for improvements, and questions about how things are meant to work.
User avatar
Hamudistan
Lobbyist
 
Posts: 13
Founded: Apr 29, 2009
Ex-Nation

[BUG] Pie charts rounding errors?

Postby Hamudistan » Fri Mar 25, 2011 2:49 am

On the one hand, the causes of death for my people add up to only 99%, on the other hand, the government expenditures add up to 101%. Are the charts supposed to balance out like that or should each individual chart represent 100%?
Last edited by Hamudistan on Fri Mar 25, 2011 2:49 am, edited 1 time in total.

User avatar
LlanfairPG
Civilian
 
Posts: 1
Founded: Feb 11, 2011
Ex-Nation

Postby LlanfairPG » Fri Mar 25, 2011 2:57 am

Maybe 1% of your population is immortal? Or we don't know how they die.

As for the Government Expendature; only having to borrow 1% from abroad is brilliant! Britain is borrowing £122 billion this year, thats over 15% of income.

User avatar
Ballotonia
Site Admin
 
Posts: 5487
Founded: Antiquity
Inoffensive Centrist Democracy

Postby Ballotonia » Fri Mar 25, 2011 3:07 am

All numbers shown are rounded, consequently the rounded numbers don't always add up to 100% exactly.

Example:
item1: 33.333333%, displayed rounded as "33".
item2: 33.333333%, displayed rounded as "33".
item3: 33.333334%, displayed rounded as "33".
Total of non-rounded values: 100%. Total of rounded values: 99%.

Ballotonia
"Een volk dat voor tirannen zwicht zal meer dan lijf en goed verliezen, dan dooft het licht…" -- H.M. van Randwijk

User avatar
Hamudistan
Lobbyist
 
Posts: 13
Founded: Apr 29, 2009
Ex-Nation

Postby Hamudistan » Tue Mar 29, 2011 12:26 am

Ballotonia wrote:All numbers shown are rounded, consequently the rounded numbers don't always add up to 100% exactly.

Example:
item1: 33.333333%, displayed rounded as "33".
item2: 33.333333%, displayed rounded as "33".
item3: 33.333334%, displayed rounded as "33".
Total of non-rounded values: 100%. Total of rounded values: 99%.

Ballotonia


This works for three or more items in the chart, but how does it work with only two?

User avatar
Ballotonia
Site Admin
 
Posts: 5487
Founded: Antiquity
Inoffensive Centrist Democracy

Postby Ballotonia » Tue Mar 29, 2011 12:57 am

Hamudistan wrote:This works for three or more items in the chart, but how does it work with only two?


Same principle applies for 2 items as well. Example:
Item 1: 50.5%, displayed rounded up as 51%.
Item 2: 49.5%, displayed rounded up as 50%.
Total of non-rounded values: 100%. Total of rounded values: 101%.

Ballotonia
"Een volk dat voor tirannen zwicht zal meer dan lijf en goed verliezen, dan dooft het licht…" -- H.M. van Randwijk

User avatar
Hamudistan
Lobbyist
 
Posts: 13
Founded: Apr 29, 2009
Ex-Nation

Postby Hamudistan » Wed Mar 30, 2011 7:05 am

No, the question is how do you end up at 99% with only two items?

User avatar
Mousebumples
Game Moderator
 
Posts: 8604
Founded: Antiquity
Inoffensive Centrist Democracy

Postby Mousebumples » Wed Mar 30, 2011 7:18 am

Hamudistan wrote:No, the question is how do you end up at 99% with only two items?

Do we KNOW that 0.5% rounds up? It's possible that the formula in place rounds DOWN.
Leader of the Mouse-a-rific Mousetastic Moderator Mousedom of Mousebumples
Past WA Delegate for Europeia & Monkey Island
Proud Member of UNOG
I'm an "adorably marvelous NatSov" - Mallorea and Riva
GA Resolutions (sorted by category) | Why Repeal? | Reppy's Sig Workshop

User avatar
HC Eredivisie
Senator
 
Posts: 3746
Founded: Antiquity
Iron Fist Consumerists

Postby HC Eredivisie » Wed Mar 30, 2011 7:28 am

Hamudistan wrote:No, the question is how do you end up at 99% with only two items?

With three items that are rounded down but have a total of 1%, like 0,4%.
Hail Richard, Chief Warlock of the Brothers of Darkness, Lord of the Thirteen Hells, Master of the Bones, Emperor of the Black, Lord of the Undead and the mayor of a little village up the coast.
+7656 posts, Joined 16 april 2003

Het Vijfde Nederlandse Topic met 1461 stemmen, 8070 posts en 144.700 views.
25-01-2005 - 08-06-2009

User avatar
[violet]
Site Admin
 
Posts: 16050
Founded: Antiquity

Postby [violet] » Thu Mar 31, 2011 2:52 pm

Mousebumples wrote:Do we KNOW that 0.5% rounds up? It's possible that the formula in place rounds DOWN.

It rounds half up.

User avatar
Hamudistan
Lobbyist
 
Posts: 13
Founded: Apr 29, 2009
Ex-Nation

Postby Hamudistan » Tue Apr 05, 2011 12:20 pm

HC Eredivisie wrote:
Hamudistan wrote:No, the question is how do you end up at 99% with only two items?

With three items that are rounded down but have a total of 1%, like 0,4%.


What does that mean?

User avatar
Ballotonia
Site Admin
 
Posts: 5487
Founded: Antiquity
Inoffensive Centrist Democracy

Postby Ballotonia » Tue Apr 05, 2011 12:38 pm

If items which round to "0%" are not listed, imagine the following example:
Item 1: 49.3%, displayed rounded down as 49%.
Item 2: 50.3%, displayed rounded down as 50%.
Item 3: 0.4%, NOT displayed since rounded down it's 0%.
Total of non-rounded values: 100%. Total of rounded values: 99%.

Ballotonia
"Een volk dat voor tirannen zwicht zal meer dan lijf en goed verliezen, dan dooft het licht…" -- H.M. van Randwijk

User avatar
Hamudistan
Lobbyist
 
Posts: 13
Founded: Apr 29, 2009
Ex-Nation

Postby Hamudistan » Wed Apr 06, 2011 6:26 am

Ballotonia wrote:If items which round to "0%" are not listed, imagine the following example:
Item 1: 49.3%, displayed rounded down as 49%.
Item 2: 50.3%, displayed rounded down as 50%.
Item 3: 0.4%, NOT displayed since rounded down it's 0%.
Total of non-rounded values: 100%. Total of rounded values: 99%.

Ballotonia


Then why does my economy pie chart show "private sector 0%, public sector 100%"? Is this a specialty of the economy pie chart or can't there be less than two item?

User avatar
Ballotonia
Site Admin
 
Posts: 5487
Founded: Antiquity
Inoffensive Centrist Democracy

Postby Ballotonia » Wed Apr 06, 2011 6:36 am

Hamudistan wrote:
Ballotonia wrote:If items which round to "0%" are not listed, imagine the following example:
Item 1: 49.3%, displayed rounded down as 49%.
Item 2: 50.3%, displayed rounded down as 50%.
Item 3: 0.4%, NOT displayed since rounded down it's 0%.
Total of non-rounded values: 100%. Total of rounded values: 99%.

Ballotonia


Then why does my economy pie chart show "private sector 0%, public sector 100%"? Is this a specialty of the economy pie chart or can't there be less than two item?


Note the "IF" my reply started off with. I can't look into the game code, just make a guess as to how things work based on what I see happening. My best guess is that indeed the "0%" in the Economy graph is an exception to the general rule.

Do you have an example of someone's Economy graph adding up to 99%, or a "0%" listed in a Government or People graph?

Ballotonia
Last edited by Ballotonia on Wed Apr 06, 2011 6:38 am, edited 2 times in total.
"Een volk dat voor tirannen zwicht zal meer dan lijf en goed verliezen, dan dooft het licht…" -- H.M. van Randwijk

User avatar
Lordieth
Post Czar
 
Posts: 31603
Founded: Jun 18, 2010
New York Times Democracy

Postby Lordieth » Wed Apr 06, 2011 7:16 am

I imagine for it to be not on the chart you would need absolute zero private spending. So 0% is rounded, however because your private spending isn't absolutely 0 it is still displayed. I think the new Tax calculations may have something to do with it, as when you get closer to 100% taxation it becomes harder to obtain it. The same goes for 0% Tax and 100% Private Sector.
There was a signature here. It's gone now.

User avatar
[violet]
Site Admin
 
Posts: 16050
Founded: Antiquity

Postby [violet] » Wed Apr 06, 2011 1:42 pm

Ballotonia wrote:Note the "IF" my reply started off with. I can't look into the game code, just make a guess as to how things work based on what I see happening. My best guess is that indeed the "0%" in the Economy graph is an exception to the general rule.

This is correct.
Last edited by [violet] on Wed Apr 06, 2011 1:43 pm, edited 1 time in total.

User avatar
[violet]
Site Admin
 
Posts: 16050
Founded: Antiquity

Postby [violet] » Wed Apr 06, 2011 1:45 pm

Lordieth wrote:I imagine for it to be not on the chart you would need absolute zero private spending. So 0% is rounded, however because your private spending isn't absolutely 0 it is still displayed.

No, with the exception of the Public vs Private sector pie slices on the Economy chart, values are not displayed unless they're at least 1% after rounding. So you may have non-zero spending that's less than 0.5% of the total but not shown.

User avatar
Lordieth
Post Czar
 
Posts: 31603
Founded: Jun 18, 2010
New York Times Democracy

Postby Lordieth » Wed Apr 06, 2011 1:47 pm

Ah. Understood. Thanks Violet.
There was a signature here. It's gone now.


Advertisement

Remove ads

Return to Technical

Who is online

Users browsing this forum: Kanaia

Advertisement

Remove ads