diff --git a/src/ccmain/paramsd.cpp b/src/ccmain/paramsd.cpp index 16130e8895..1f862178d5 100644 --- a/src/ccmain/paramsd.cpp +++ b/src/ccmain/paramsd.cpp @@ -28,10 +28,12 @@ #include "paramsd.h" #include // for fclose, fopen, fprintf, sprintf, FILE -#include // for atoi, strtod +#include // for atoi #include // for strcmp, strcspn, strlen, strncpy +#include // for std::locale::classic #include // for map, _Rb_tree_iterator, map<>::iterator #include // for unique_ptr +#include // for std::stringstream #include // for pair #include "genericvector.h" // for GenericVector #include "params.h" // for ParamsVectors, StringParam, BoolParam @@ -158,7 +160,12 @@ void ParamContent::SetValue(const char* val) { } else if (param_type_ == VT_BOOLEAN) { bIt->set_value(atoi(val)); } else if (param_type_ == VT_DOUBLE) { - dIt->set_value(strtod(val, nullptr)); + std::stringstream stream(val); + // Use "C" locale for reading double value. + stream.imbue(std::locale::classic()); + double d = 0; + stream >> d; + dIt->set_value(d); } else if (param_type_ == VT_STRING) { sIt->set_value(val); }