Refactored script RAM usage to be calculated based on commands. Updated RAM on foreign servers to balance. Balnaced company wages

This commit is contained in:
Daniel Xie
2017-05-10 16:10:06 -05:00
parent 3808fe5a3f
commit 416f3e7b47
7 changed files with 66 additions and 24 deletions

View File

@@ -71,4 +71,22 @@ function formatNumber(num, numFractionDigits) {
minimumFractionDigits: numFractionDigits,
maximumFractionDigits: numFractionDigits
});
}
//Counters the number of times a substring occurs in a string
function numOccurrences(string, subString) {
string += "";
subString += "";
if (subString.length <= 0) return (string.length + 1);
var n = 0, pos = 0, step = subString.length;
while (true) {
pos = string.indexOf(subString, pos);
if (pos >= 0) {
++n;
pos += step;
} else break;
}
return n;
}