From c4f8d53321368e2e964edf11a2ba28d6ae961cba Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Sat, 25 Nov 2023 12:34:28 -0700 Subject: [PATCH] fedimbed.polls: round percents, add counts --- src/modules/fedimbed.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/modules/fedimbed.js b/src/modules/fedimbed.js index 9ff57c7..67f7640 100644 --- a/src/modules/fedimbed.js +++ b/src/modules/fedimbed.js @@ -623,12 +623,14 @@ async function processUrl(msg, url, spoiler = false) { const percent = o.count / poll.total; const bar = Math.round(percent * 30); - return `**${o.name}** (${(percent * 100).toFixed( - 2 + return `**${o.name}** (${o.count}, ${Math.round( + percent * 100 )}%)\n\`[${"=".repeat(bar)}${" ".repeat(30 - bar)}]\``; }) .join("\n\n") + - `\n\nEnds: `, + `\n\n${poll.total} votes \u2022 Ends `, }); }