nns-dapp
nns-dapp copied to clipboard
Improve accuracy of calculation for total voting power
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.
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.
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:
Click the copy icon on the left and you get this in your clipboard: 82e3d388986a85a38d41bdf97721bc4e28ec28c0