Skip to content
Snippets Groups Projects
Commit 06eb0b78 authored by brickode's avatar brickode
Browse files

Added printCost() function

parent a3506583
No related branches found
No related tags found
No related merge requests found
......@@ -491,6 +491,33 @@ window.cashFormat = function(s) {
return "¤"+commaNum(s);
};
window.printCost = (function() {
let V;
let r;
function printCost(cost, upkeep, arcology) {
V = State.variables
r = "";
if (!upkeep) {
upkeep = 0
}
if (!arcology) {
arcology = 0
}
r += `//Costs <span class=yellowgreen><<print cashFormat(Math.trunc(` + cost
if (arcology == 0) {
r += `*${V.upgradeMultiplierArcology}))>></span>//`
} else {
r += `))>></span>//`
}
if (upkeep == 1) {
r += `// and will incur upkeep costs//`
}
return r;
};
return printCost;
})();
window.isFloat = function(n){
return n === +n && n !== (n|0);
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment