Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XmlRpcValue ignores the value of _doubleFormat #1958

Closed
peci1 opened this issue May 20, 2020 · 5 comments · Fixed by #2003
Closed

XmlRpcValue ignores the value of _doubleFormat #1958

peci1 opened this issue May 20, 2020 · 5 comments · Fixed by #2003
Labels

Comments

@peci1
Copy link
Contributor

peci1 commented May 20, 2020

https://github.com/ros/ros_comm/search?q=_doubleformat&unscoped_q=_doubleformat
https://github.com/ros/ros_comm/search?q=getdoubleformat&unscoped_q=getdoubleformat

This value has no use at all.

XmlRpc::XmlRpcValue::setDoubleFormat("%.2f");
std::stringstream ss;
ss << XmlRpc::XmlRpcValue(2.0);
EXPECT_EQ("2.00", ss.str());

This fails. The output of ss.str() is "2".

@dirk-thomas
Copy link
Member

Please consider to contribute a pull request to fix the issue.

@fujitatomoya
Copy link
Contributor

@peci1 @dirk-thomas

i do not think that this is bug in ros_comm but application. it just prints with "%.16g" format as default as expected. It needs to call method setDoubleFormat("%.2f") with object XmlRpcValue(2.0).

@dirk-thomas
Copy link
Member

It needs to call method setDoubleFormat("%.2f") with object XmlRpcValue(2.0).

@fujitatomoya setDoubleFormat is static so it doesn't operate on a specific XmlRpcValue instance.

@fujitatomoya
Copy link
Contributor

setDoubleFormat is static so it doesn't operate on a specific XmlRpcValue instance.

right, i was too early. my bad.

@fujitatomoya
Copy link
Contributor

@peci1
CC: @dirk-thomas

it would be nice if you could confirm #2003 fixes the problem. (I did it locally but just in case.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants