Skip to content

Commit

Permalink
present VOTE as WAX and format as currency
Browse files Browse the repository at this point in the history
  • Loading branch information
rakeden committed Nov 24, 2023
1 parent f3d754c commit cfdf958
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/store/modules/ballot.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,14 @@ const actions = {

state.candidates.forEach((candidate) => {
votingBallots.forEach((votes) => {
let voteToCurrency = parseFloat(votes.value.split(' ')[0])
.toFixed(2)
.replace(/\d(?=(\d{3})+\.)/g, '$&,')

if (votes.key === candidate.owner) {
candidatesWithVotes.push({
...candidate,
votes: parseFloat(votes.value.split(' ')[0]).toFixed(2) + ' VOTE'
votes: voteToCurrency + ' WAX'
});
}
});
Expand Down

0 comments on commit cfdf958

Please sign in to comment.