From caf12e9598e85a3471bd426c14b867c1aeea6469 Mon Sep 17 00:00:00 2001 From: Nicolas CHABALIER Date: Fri, 8 Mar 2024 17:08:36 +0100 Subject: [PATCH] Fix: added the wrong correction, in the precendent commit. --- src/main/java/org/math/R/AbstractR2jsSession.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/math/R/AbstractR2jsSession.java b/src/main/java/org/math/R/AbstractR2jsSession.java index 66b0a5f..b922d6d 100644 --- a/src/main/java/org/math/R/AbstractR2jsSession.java +++ b/src/main/java/org/math/R/AbstractR2jsSession.java @@ -385,6 +385,10 @@ protected String convertRtoJs(String e) throws RException { // modify them in this function quotesList = replaceQuotesByVariables(e, 1); + // Get the expression with replaced quotes (it's the first element of + // the returned list) + e = quotesList.get(0); + //1E-8 -> 1*10^-8 //e = e.replaceAll("(\\d|\\d\\.)[eE]+([+-])*(\\d)", "$1*10^$2$3"); Matcher m = Pattern.compile("(\\d|\\d\\.)+[eE]+([+-])*(\\d*)").matcher(e); @@ -395,9 +399,7 @@ protected String convertRtoJs(String e) throws RException { } } - // Get the expression with replaced quotes (it's the first element of - // the returned list) - e = quotesList.get(0); + checkExpressionValidity(e);