diff --git a/src/js/economyJS.js b/src/js/economyJS.js index b5d2e911456e1801e6289f740ef4fc9983f8d671..2d1585ffe3f661e65fd0d91345092dd548b7ec9c 100644 --- a/src/js/economyJS.js +++ b/src/js/economyJS.js @@ -515,7 +515,7 @@ window.getEnvironmentCosts = function(cost) { cost *= (1 - State.variables.railway * 0.05); } } - return cost; + return Math.trunc(cost); }; window.getSFCosts = function() { @@ -1108,6 +1108,9 @@ window.cashX = function(cost, what, who) { return 0; } + //remove fractions from the money + cost = Math.trunc(cost); + //Spend the money V.cash += cost; diff --git a/src/js/utilJS.js b/src/js/utilJS.js index 68ea053731c411abbff5926b7392be4481e452d1..7c66513e064d3b7afbe6f849fc2539f7611e467f 100644 --- a/src/js/utilJS.js +++ b/src/js/utilJS.js @@ -486,7 +486,7 @@ window.commaNum = function(s) { window.cashFormat = function(s) { if (!s) { s = 0; } - return "¤" + commaNum(Math.round(s * 100) / 100); + return "¤" + commaNum(s); }; window.repFormat = function(s) { diff --git a/src/uncategorized/costsBudget.tw b/src/uncategorized/costsBudget.tw index 4025a6aaae4d1ebc0cc69ef0f75db6a3c8b1dc85..53d199c1e8b95d3f13b2d48508b3e8697e5f9aa5 100644 --- a/src/uncategorized/costsBudget.tw +++ b/src/uncategorized/costsBudget.tw @@ -333,11 +333,11 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <td></td> <td>/*<<print ($lastWeeksCashExpenses.Total + $costs)>>*/</td> <td><<if (($cash-$cashLastWeek) - $lastWeeksCashProfits.Total) > 0>> - @@.yellowgreen;+<<print cashFormat(Math.trunc(($cash-$cashLastWeek) - $lastWeeksCashProfits.Total))>>@@ - <<elseif Math.trunc((($cash-$cashLastWeek) - $lastWeeksCashProfits.Total)) == 0>> - <<print cashFormat(Math.trunc((($cash-$cashLastWeek) - $lastWeeksCashProfits.Total)))>> + @@.yellowgreen;+<<print cashFormat(($cash-$cashLastWeek) - $lastWeeksCashProfits.Total)>>@@ + <<elseif (($cash-$cashLastWeek) - $lastWeeksCashProfits.Total) == 0>> + <<print cashFormat((($cash-$cashLastWeek) - $lastWeeksCashProfits.Total))>> <<else>> - @@.red;-<<print cashFormat(Math.abs(Math.trunc(($cash-$cashLastWeek) - $lastWeeksCashProfits.Total)))>>@@ + @@.red;-<<print cashFormat(Math.abs(($cash-$cashLastWeek) - $lastWeeksCashProfits.Total))>>@@ <</if>></td> </tr> <</if>>