v0.3, fix divide-by-zero, change tabs to space
This commit is contained in:
parent
c06682b991
commit
8067d20117
@ -1,7 +1,7 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @id iitc-plugin-guess-player-levels@breunigs
|
// @id iitc-plugin-guess-player-levels@breunigs
|
||||||
// @name iitc: guess player level
|
// @name iitc: guess player level
|
||||||
// @version 0.2.1.1
|
// @version 0.3
|
||||||
// @namespace https://github.com/breunigs/ingress-intel-total-conversion
|
// @namespace https://github.com/breunigs/ingress-intel-total-conversion
|
||||||
// @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/guess-player-levels.user.js
|
// @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/guess-player-levels.user.js
|
||||||
// @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/guess-player-levels.user.js
|
// @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/guess-player-levels.user.js
|
||||||
@ -112,8 +112,9 @@ window.plugin.guessPlayerLevels.guess = function() {
|
|||||||
}
|
}
|
||||||
s += '\nTotal level :\t'+totallvlR+'\tTotal level :\t'+totallvlE;
|
s += '\nTotal level :\t'+totallvlR+'\tTotal level :\t'+totallvlE;
|
||||||
s += '\nTotal player:\t'+namesR.length+'\tTotal player:\t'+namesE.length;
|
s += '\nTotal player:\t'+namesR.length+'\tTotal player:\t'+namesE.length;
|
||||||
var averageR = (totallvlR/namesR.length);
|
var averageR = 0, averageE = 0;
|
||||||
var averageE = (totallvlE/namesE.length);
|
if (namesR.length > 0) averageR = (totallvlR/namesR.length);
|
||||||
|
if (namesE.length > 0) averageE = (totallvlE/namesE.length);
|
||||||
s += '\nAverage :\t'+averageR.toFixed(2)+'\tAverage :\t'+averageE.toFixed(2);
|
s += '\nAverage :\t'+averageR.toFixed(2)+'\tAverage :\t'+averageE.toFixed(2);
|
||||||
s += '\n\nIf there are some unresolved names, simply try again.'
|
s += '\n\nIf there are some unresolved names, simply try again.'
|
||||||
console.log(s);
|
console.log(s);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user