nns-dapp icon indicating copy to clipboard operation
nns-dapp copied to clipboard

Improve accuracy of calculation for total voting power

Open wpb1 opened this issue 1 year ago • 1 comments

Problem: It appears that stake, age bonus, dissolve delay bonus, and voting power are all displayed with 2 decimal places. However, the actual calculation is based on a lot more decimal places. Hence, a manual calculation based on the parameters on display does not equal to the voting power that is displayed. In the example below, the manually calculated value is 6342.49 and the displayed value is 6324.62, which is a discrepancy of 23.94 votes. This was enough for the end user who provided this screen capture to question the accuracy of the calculations.

image

Solution: If the voting power result that is displayed is going to have 6 significant figures as shown in the screen capture, then the age bonus and the dissolve delay bonus need to be shown with 6 significant figures as well. Alternatively, if age bonus and dissolve delay bonus are going to be displayed with 3 significant digits, then the voting power result should also have only 3 significant figures. From a more practical perspective, you could display 4 decimal places for age bonus and dissolve delay bonus. Then the rounding discrepancies would only be evident in the largest neurons.

wpb1 avatar Nov 11 '23 05:11 wpb1

Note: I have seen and liked web pages that have a copy button that provides the full value, while normally showing only a summary. It's in quite a few web pages but an example in a page I have open right now is the way GitHub shows an abbreviated hash, but if you click the copy button you get the full hash in the clipboard. Maybe something like that might help. What do you think?

The way GitHub shows commit hashes: Screenshot from 2023-11-11 12-14-12

Click the copy icon on the left and you get this in your clipboard: 82e3d388986a85a38d41bdf97721bc4e28ec28c0

bitdivine avatar Nov 11 '23 11:11 bitdivine