Web Design Discussion > General Web Design Discussion

0% / 100% vs 0.00% / 100.00%

(1/4) > >>

yakra:
Sometimes stats percentages are displayed with trailing zeros, sometimes not. For example,
http://travelmapping.net/user/system.php?units=miles&u=duke87&sys=usari
Distance Traveled is displayed as 100%.
Routes Traveled & Clinched are displayed as 100.00%.

Why, how?
Sometimes the percentages are rounded right in the SQL queries themselves. These get trailing 0s.
Sometimes the percentages are calculated & rounded by a PHP function. These don't get trailing 0s.

Do we want to standardize on the one, or the other? Do we care enough about this to even bother making the changes to standardize?

My opinion:
I like the cleaner look of 0%, 100%, etc.
If in the future we add more info to state stats tables & make them wider, 100% vice 100.00% will save us a wee bit of room.

Efficiency:
Rounding via PHP will in many cases allow us to simplify our SQL queries in many cases, eliminating LEFT JOINs, etc.
The fact that the trailing zeros are included when rounded via SQL suggests to me that these values are being stored/manipulated as strings rather than floats, which would be a bit less efficient, innit?

Jim:
I'd prefer to make the 0 and 100 display without the decimal places consistently.  My only argument against changes that affect log files is that I like using diff to see changes and this would cause a whole bunch of "false positive" changes that would make it harder to find the real ones.

michih:
I also think that there should always be the same number of decimal places.
However, I prefer 2, especially because "almost 100" might be rounded to 100% and one might think having a route or even system clinched. For instance, I've clinched 99.89% of auts and 99.82% of deua system. I don't wanna miss "almost clinched" routes or systems.

Jim:
I think the idea is that the 0% and 100% would only be shown as such when it's legitimately 0 or 100.  All values in between would continue to have 2 digits after the decimal.

yakra:
Trailing zeros would be truncated, i.e. 5.9 instead of 5.90.
Almost-0 or almost-100 values are still at risk of being rounded if they're off by 1/200 of a percent or less; this is already the case.
I'm not considering any changes to log files here; this thread was just about the web front end.

Navigation

[0] Message Index

[#] Next page

Go to full version