src/Network/props.cxx: use std::setprecision(16) when sending double values.
This commit is contained in:
parent
f5243e7e7d
commit
581e7980b3
1 changed files with 11 additions and 1 deletions
|
@ -430,8 +430,18 @@ FGProps::PropsChannel::foundTerminator()
|
||||||
push( getTerminator() );
|
push( getTerminator() );
|
||||||
} else if ( command == "get" || command == "show" ) {
|
} else if ( command == "get" || command == "show" ) {
|
||||||
if ( tokens.size() == 2 ) {
|
if ( tokens.size() == 2 ) {
|
||||||
|
std::string value;
|
||||||
|
SGPropertyNode* n = node->getNode(tokens[1].c_str());
|
||||||
|
if (n && n->getType() == simgear::props::DOUBLE) {
|
||||||
|
// Use extra precision so we can represent UTC times etc.
|
||||||
|
std::ostringstream s;
|
||||||
|
s << std::setprecision(16) << n->getDoubleValue();
|
||||||
|
value = s.str();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
value = node->getStringValue ( tokens[1].c_str(), "" );
|
||||||
|
}
|
||||||
string tmp;
|
string tmp;
|
||||||
string value = node->getStringValue ( tokens[1].c_str(), "" );
|
|
||||||
if ( mode == PROMPT ) {
|
if ( mode == PROMPT ) {
|
||||||
tmp = tokens[1];
|
tmp = tokens[1];
|
||||||
tmp += " = '";
|
tmp += " = '";
|
||||||
|
|
Loading…
Reference in a new issue