From 132834c3fd0337de2ad126d394fd73e59e296231 Mon Sep 17 00:00:00 2001 From: michael Date: Wed, 17 Jul 2024 16:07:23 +0200 Subject: [PATCH] Update Helper.cpp --- code/components/jomjol_helper/Helper.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/code/components/jomjol_helper/Helper.cpp b/code/components/jomjol_helper/Helper.cpp index c4112ecf..78d359e3 100644 --- a/code/components/jomjol_helper/Helper.cpp +++ b/code/components/jomjol_helper/Helper.cpp @@ -1221,6 +1221,14 @@ void replaceAll(std::string& s, const std::string& toReplace, const std::string& bool isStringNumeric(std::string &input) { + if (input.size() <= 0) + { + return false; + } + + // Replace comma with a dot + replaceString(input, ",", ".", false); + int start = 0; int punkt_existiert_schon = 0; @@ -1231,8 +1239,7 @@ bool isStringNumeric(std::string &input) for (int i = start; i < input.size(); i++) { - // if ((ispunct(input[i])) && (i > 0) && (punkt_existiert_schon == 0)) - if (((input[i] == '.') || (input[i] == ',')) && (i > 0) && (punkt_existiert_schon == 0)) + if ((input[i] == '.') && (i > 0) && (punkt_existiert_schon == 0)) { punkt_existiert_schon = 1; i++;