Fixes conditions with floating point numbers
Reported in SD-9504 Bug introduced in423ae8977e
SD-9217 Commit related to1a4d33879a
, which tried to fix the issue
This commit is contained in:
parent
56e7174e42
commit
ec8e0aa975
|
@ -99,7 +99,7 @@ public class GeneralUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Object parseJS(String toParse, String type, Object def) {
|
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();
|
toParse = toParse.trim();
|
||||||
|
|
||||||
double firstNumber = Double.parseDouble(toParse.substring(0, toParse.indexOf(" ")));
|
double firstNumber = Double.parseDouble(toParse.substring(0, toParse.indexOf(" ")));
|
||||||
|
|
Loading…
Reference in New Issue