fedimbed.polls: * 100 percentages

This commit is contained in:
Cynthia Foxwell 2023-11-25 12:31:45 -07:00
parent d209d12506
commit 0e4aa68fc9

View file

@ -623,9 +623,9 @@ async function processUrl(msg, url, spoiler = false) {
const percent = o.count / poll.total;
const bar = Math.round(percent * 30);
return `**${o.name}** (${percent.toFixed(2)}%)\n\`[${"=".repeat(
bar
)}${" ".repeat(30 - bar)}]\``;
return `**${o.name}** (${(percent * 100).toFixed(
2
)}%)\n\`[${"=".repeat(bar)}${" ".repeat(30 - bar)}]\``;
})
.join("\n\n") +
`\n\nEnds: <t:${Math.floor(poll.end.getTime() / 1000)}:R>`,