ソースを参照

Update Helper.cpp

michael 1 年間 前
コミット
132834c3fd
1 ファイル変更9 行追加2 行削除
  1. 9 2
      code/components/jomjol_helper/Helper.cpp

+ 9 - 2
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)
 bool isStringNumeric(std::string &input)
 {
 {
+	if (input.size() <= 0)
+	{
+		return false;
+	}
+    
+	// Replace comma with a dot
+	replaceString(input, ",", ".", false);
+	
 	int start = 0;
 	int start = 0;
 	int punkt_existiert_schon = 0;
 	int punkt_existiert_schon = 0;
 
 
@@ -1231,8 +1239,7 @@ bool isStringNumeric(std::string &input)
 
 
 	for (int i = start; i < input.size(); i++)
 	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;
 			punkt_existiert_schon = 1;
 			i++;
 			i++;