From ec8e0aa975eec568e47eebc5878624b408e07a8b Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Thu, 6 Apr 2023 09:39:53 +0200 Subject: [PATCH] Fixes conditions with floating point numbers Reported in SD-9504 Bug introduced in 423ae8977efeae2381c352a4def341a60050ce1b SD-9217 Commit related to 1a4d33879a6399dea08c0e4a91b6596e5e6a7b3c, which tried to fix the issue --- .../com/songoda/epicenchants/utils/single/GeneralUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/songoda/epicenchants/utils/single/GeneralUtils.java b/src/main/java/com/songoda/epicenchants/utils/single/GeneralUtils.java index 696807b..8d6cae5 100644 --- a/src/main/java/com/songoda/epicenchants/utils/single/GeneralUtils.java +++ b/src/main/java/com/songoda/epicenchants/utils/single/GeneralUtils.java @@ -99,7 +99,7 @@ public class GeneralUtils { } public static Object parseJS(String toParse, String type, Object def) { - if (toParse.trim().matches("^\\d+\\s+(<|>)\\s*\\d+$")) { // e.g. "1 < 2" + if (toParse.trim().matches("^\\d+(?>\\.\\d+)?\\s+([<>])\\s*\\d+(?>\\.\\d+)?$")) { // e.g. "1 < 2" toParse = toParse.trim(); double firstNumber = Double.parseDouble(toParse.substring(0, toParse.indexOf(" ")));