mirror of
https://github.com/zedeus/nitter.git
synced 2024-12-13 03:26:30 +00:00
parent
42421e58de
commit
240a6f9fd3
1 changed files with 2 additions and 1 deletions
|
@ -120,7 +120,8 @@ proc renderPoll(poll: Poll): VNode =
|
|||
for i in 0 ..< poll.options.len:
|
||||
let
|
||||
leader = if poll.leader == i: " leader" else: ""
|
||||
perc = poll.values[i] / poll.votes * 100
|
||||
val = poll.values[i]
|
||||
perc = if val > 0: val / poll.votes * 100 else: 0
|
||||
percStr = (&"{perc:>3.0f}").strip(chars={'.'}) & '%'
|
||||
tdiv(class=("poll-meter" & leader)):
|
||||
span(class="poll-choice-bar", style={width: percStr})
|
||||
|
|
Loading…
Reference in a new issue