Round poll percentage

This commit is contained in:
Maxim Filippov 2019-04-04 15:16:11 +03:00
parent 93aedd6fd7
commit 706da8402e
1 changed files with 5 additions and 1 deletions

View File

@ -32,7 +32,11 @@ export default {
},
methods: {
percentageForOption: function (count) {
return count / this.totalVotesCount * 100
if (this.totalVotesCount === 0) {
return 0
}
return (count / this.totalVotesCount * 100).toFixed(1)
}
}
}