Skip to content
Snippets Groups Projects
Commit c6e7ae4e authored by Jorrit Fahlke's avatar Jorrit Fahlke
Browse files

Don't loose precision when using the default value for a ConfigParser key.

[[Imported from SVN: r5909]]
parent 8af7c9ce
No related branches found
No related tags found
No related merge requests found
......@@ -231,11 +231,10 @@ int ConfigParser::get(const string& key, int defaultValue)
double ConfigParser::get(const string& key, double defaultValue)
{
stringstream stream;
stream << defaultValue;
string ret = get(key, stream.str());
return atof(ret.c_str());
if(hasKey(key))
return atof((*this)[key].c_str());
else
return defaultValue;
}
bool ConfigParser::get(const string& key, bool defaultValue)
......
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