Skip to content

Commit

Permalink
feat: format voting power and total votes (#5623)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tuditi committed Jan 20, 2023
1 parent acf5f7a commit 84d6f33
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
updateParticipationOverview,
} from '@contexts/governance/stores'
import { calculateWeightedVotes } from '@contexts/governance/utils'
import { formatTokenAmountBestMatch } from '@core/wallet/utils'
import { visibleSelectedAccountAssets } from '@core/wallet/stores'
const { metadata } = $visibleSelectedAccountAssets?.baseCoin
let selectedAnswerValues: number[] = []
let votedAnswerValues: number[] = []
Expand All @@ -41,7 +45,7 @@
$: votesCounter = {
total: totalVotes,
power: $selectedAccount?.votingPower,
power: parseInt($selectedAccount?.votingPower),
}
$: questions = votingPayload?.questions
Expand Down Expand Up @@ -131,7 +135,7 @@
<li>
<KeyValueBox
keyText={localize(`views.governance.details.yourVote.${counterKey}`)}
valueText={votesCounter[counterKey].toString()}
valueText={formatTokenAmountBestMatch(votesCounter[counterKey], metadata)}
/>
</li>
{/each}
Expand Down

0 comments on commit 84d6f33

Please sign in to comment.