Update Helper.cpp

This commit is contained in:
michael
2024-07-17 16:07:23 +02:00
committed by GitHub
parent d3d9c64f3b
commit 132834c3fd

View File

@@ -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++;