Skip to content

Commit

Permalink
Fix mobile crasher
Browse files Browse the repository at this point in the history
  • Loading branch information
ChewingGlass committed Jan 20, 2024
1 parent f1a0058 commit b06024d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/features/governance/ProposalScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ export const ProposalScreen = () => {
index,
percent: totalVotes?.isZero()
? 100 / proposal?.choices.length
: (r.weight.toNumber() / totalVotes.toNumber()) * 100,
: // Calculate with 4 decimals of precision
r.weight.mul(new BN(10000)).div(totalVotes).toNumber() *
(100 / 10000),
}))

return { results, totalVotes }
Expand Down

0 comments on commit b06024d

Please sign in to comment.