From e38d817db9026b531e07b49bb4855ee5f2571839 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 20 Nov 2017 14:47:29 +0700 Subject: [PATCH] Bug --- routes/apartment.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routes/apartment.js b/routes/apartment.js index 20c2301..7cedf8d 100644 --- a/routes/apartment.js +++ b/routes/apartment.js @@ -41,13 +41,13 @@ module.exports.set = function(router, pool) { budgetRemain = Math.round((budgetRemain * 100))/100; budgetRemain = budgetRemain.toString(); - if (budgetRemain[budgetRemain.indexOf(".")+2] == undefined){ + if (budgetRemain[budgetRemain.indexOf(".")+2] == undefined && budgetRemain[budgetRemain.indexOf(".")] != undefined){ budgetRemain = budgetRemain.concat("0"); } apartmentTransferBudget = Math.round((apartmentTransferBudget * 100))/100; apartmentTransferBudget = apartmentTransferBudget.toString(); - if (apartmentTransferBudget[apartmentTransferBudget.indexOf(".")+2] == undefined){ + if (apartmentTransferBudget[apartmentTransferBudget.indexOf(".")+2] == undefined && apartmentTransferBudget[apartmentTransferBudget.indexOf(".")] != undefined){ apartmentTransferBudget = apartmentTransferBudget.concat("0"); } response.render('apartment/apartment_transfer', {