truncation of double
Status: Beta
Brought to you by:
cmorley
When returning a double, XmlRpc++ truncates its
precision, as in the example below,
void execute(XmlRpcValue& params, XmlRpcValue& result)
{
double res = 1.7872827392;
result = res;
}
where the double 1.7872827392 should have been
returned. Instead the returned value is
1.787283
This is due to the XmlRpcValue::ToXml, which indirect
uses the _doubleFormat string, defined as follows:
std::string XmlRpcValue::_doubleFormat("%f");
So the transmitted Xml string is
<value><double>1.787283</double></value>
A solution could be the _doubleFormat("%.17f)