Skip to content

Commit

Permalink
dcrdata/views: fix tspend vote turnout percentage (#2004)
Browse files Browse the repository at this point in the history
- display zero instead of NAN when there are no tspend votes

Signed-off-by: Philemon Ukane <[email protected]>
  • Loading branch information
ukane-philemon authored Sep 21, 2024
1 parent 182e2bd commit ae8f5c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/dcrdata/views/tx.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@
<tr>
<td class="text-end medium-sans text-nowrap pe-2 py-2">Votes Cast:</td>
<td class="text-start py-1 text-secondary"> {{.TotalVotes}}
({{printf "%.0f" (percentage .TotalVotes .EligibleVotes)}}% turnout)
({{if gt .TotalVotes 0}}{{printf "%.0f" (percentage .TotalVotes .EligibleVotes)}}{{else}}0{{end}}% turnout)
</td>
{{if not .Approved}}
<td class="text-end medium-sans text-nowrap pe-2 py-2" >Voting Ends In:</td>
Expand Down

0 comments on commit ae8f5c2

Please sign in to comment.