Parameters: removed trailing 0 for double/float parameters, to avoid serializing with them (so that we don't have the 0.0 != 0 when loading parameters from database)

This commit is contained in:
matlabbe
2016-06-16 15:34:27 -04:00
parent 62a982ef9f
commit d03b54d95a
3 changed files with 23 additions and 21 deletions

View File

@@ -94,11 +94,13 @@ std::string Parameters::serialize(const ParametersMap & parameters)
// make sure there are no commas instead of dots
output << iter->first << ":" << uReplaceChar(iter->second, ',', '.');
}
UDEBUG("output=%s", output.str().c_str());
return output.str();
}
ParametersMap Parameters::deserialize(const std::string & parameters)
{
UDEBUG("parameters=%s", parameters.c_str());
ParametersMap output;
std::list<std::string> tuplets = uSplit(parameters, ';');
for(std::list<std::string>::iterator iter=tuplets.begin(); iter!=tuplets.end(); ++iter)