mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 11:48:08 +08:00
Migrate Discourse Polls to use vdom instead of embedded ember
This commit is contained in:
@ -3,7 +3,7 @@ function sumsUpTo100(percentages) {
|
||||
return percentages.map(p => Math.floor(p)).reduce((a, b) => a + b) === 100;
|
||||
}
|
||||
|
||||
export default (percentages) => {
|
||||
export default function(percentages) {
|
||||
var decimals = percentages.map(a => a % 1);
|
||||
const sumOfDecimals = Math.ceil(decimals.reduce((a, b) => a + b));
|
||||
// compensate error by adding 1 to n items with the greatest decimal part
|
||||
|
Reference in New Issue
Block a user