Skip to content
Snippets Groups Projects
Commit 1824766c authored by Ramin Yaghoubzadeh Torky's avatar Ramin Yaghoubzadeh Torky
Browse files

Bugfix: float numbers in strings now correctly converted

parent d245cfe3
No related branches found
No related tags found
No related merge requests found
...@@ -95,10 +95,10 @@ double strict_numerical_interpretation(const std::string& str) ...@@ -95,10 +95,10 @@ double strict_numerical_interpretation(const std::string& str)
char* endptr; char* endptr;
auto s = str_trim(str); auto s = str_trim(str);
const char* startptr = s.c_str(); const char* startptr = s.c_str();
long l = strtod(startptr, &endptr); double d = strtod(startptr, &endptr);
if ((*endptr)=='\0') { if ((*endptr)=='\0') {
// everything could be parsed // everything could be parsed
return l; return d;
} else { } else {
throw PayloadTypeConversionError(); throw PayloadTypeConversionError();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment