Commit daf0061e by Tomas Dvorak

Merge pull request #94 from todvora/master

Math.max.apply replaced by reduce - RangeError (#93) fixed.
parents 13f19e5c eef2a54e
......@@ -281,7 +281,7 @@ if($outputFormat === 'json') {
return res !== null ? res[1].length : 1;
};
var maxDigits = Math.max.apply(null, varietyResults.map(function(value){return significantDigits(value.percentContaining);}));
var maxDigits = varietyResults.map(function(value){return significantDigits(value.percentContaining);}).reduce(function(acc,val){return acc>val?acc:val;});
varietyResults.forEach(function(key) {
table.push([key._id.key, key.value.types.toString(), key.totalOccurrences.toString(), key.percentContaining.toFixed(maxDigits).toString()]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment