From 9642dddb84930191ccfc2189d5bc02a067f553d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hubert=20Soko=C5=82owski?= Date: Tue, 20 Jun 2023 02:27:10 +0200 Subject: [PATCH] fix test tree with parseFloat while updating set --- src/components/Node/ModalPopup.jsx | 4 ++-- src/utils/RebuilderTestTree.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/Node/ModalPopup.jsx b/src/components/Node/ModalPopup.jsx index 3ea040a..8f00d41 100644 --- a/src/components/Node/ModalPopup.jsx +++ b/src/components/Node/ModalPopup.jsx @@ -103,8 +103,8 @@ function ModalPopup({ colorScheme={state.pivot == x.attribute2 ? 'green' : 'gray'} /> - - + + ))} diff --git a/src/utils/RebuilderTestTree.js b/src/utils/RebuilderTestTree.js index daeaa1f..ad0dad4 100644 --- a/src/utils/RebuilderTestTree.js +++ b/src/utils/RebuilderTestTree.js @@ -63,12 +63,12 @@ var predicates = { return a === b; }, '>=': function (a, b) { - return a >= b; + return parseFloat(a) >= parseFloat(b); }, '<': function (a, b) { - return a < b; + return parseFloat(a) < parseFloat(b); }, w: function (a, b, w) { - return a < w * b; + return parseFloat(a) < parseFloat(w) * parseFloat(b); }, };