Open mholtrop opened 3 years ago
Humbug. Seems:
{
// Scan the c_string str for numbers only, then return the value as a float.
// The str is not allowed to have spaces or alphanumerics, only 0-9 and .
int i=0;
while(char c=str[i++]) if(isalpha(c) && !(c=='-' || c=='+' || c=='e' || c=='E') )
{
cout << "WARNING: Unexpected Alphanumberic character found in number string:" << str << endl;
}
return( stringToDouble(str));
}
works as well. (Updated code a few hours ago.)
this doesn't work when for "8,3e3" where "," is a mistake for "." while(char c=str[i++]) if(isalpha(c) && !(c=='-' || c=='+' || c=='e' || c=='E') )
this works better while(char c=str[i++]) if(!(isdigit(c) || c=='-' || c=='+' || c=='e' || c=='E' || c=='.'))
Mauri, can you fix this bug?
Ah yes, thanks Zhiwen, that would be data entries by our European collaborators (where . is exchanged with , in numbers sometimes).
Error is in the updated code. Corrected code, string_utilities.cc:54 is: