From 62703be75d26ff1139523bc1021cec9da05b8d4f Mon Sep 17 00:00:00 2001 From: Wahyu Ramadhan Date: Thu, 8 Jun 2023 16:23:00 +0700 Subject: [PATCH] Fix floating rounding error --- edit-mode/function/ganttConfig.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/edit-mode/function/ganttConfig.js b/edit-mode/function/ganttConfig.js index 2cd8059..f5662bf 100644 --- a/edit-mode/function/ganttConfig.js +++ b/edit-mode/function/ganttConfig.js @@ -349,7 +349,7 @@ var allColumns = [ } }, // { name: "status", label: "Status", align: "center", editor: editor.status, resize: true }, { name: "bobot_planning", label: "Bobot Activity (%)", align: "center", editor: editor.bobot_planning, resize: true, min_width: 115, template: function (text) { - if(text.bobot_planning > 100){ + if(text.bobot_planning.toFixed(2) > 100){ gantt.alert("Bobot tidak boleh lebih dari 100%!"); return; } @@ -367,7 +367,7 @@ var allColumns = [ { name:"progress_actual", label: "Total Actual Progress (%)", align: "center", min_width: 150, template: function (text) { let progress = text.progress progress = progress*100 - if(progress > 100){ + if(progress.toFixed(2) > 100){ gantt.alert("Bobot tidak boleh lebih dari 100%!"); return; }