Boost C++ Libraries: Ticket #2994: default value output precision https://svn.boost.org/trac10/ticket/2994 <p> If I make an option like this: ("maxlength", po::value&lt;double&gt;(&amp;<a class="missing wiki">MaxLength</a>)-&gt;default_value(.1), "Maximum edge length to keep.") </p> <p> The help message looks like this: --maxlength arg (=0.10000000000000001) Maximum edge length to keep. </p> <p> It probably should default to fewer decimal points. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2994 Trac 1.4.3 s.ochsenknecht@… Tue, 10 Nov 2009 13:38:54 GMT attachment set https://svn.boost.org/trac10/ticket/2994 https://svn.boost.org/trac10/ticket/2994 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">ticket2994.patch</span> </li> </ul> <p> test case </p> Ticket s.ochsenknecht@… Tue, 10 Nov 2009 13:42:28 GMT <link>https://svn.boost.org/trac10/ticket/2994#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2994#comment:1</guid> <description> <p> I'm afraid that a certain, hard coded, output precision wouldn't satisfy all users. But there as an overloaded version of default_value() which can be used to define the string representation of the default value: </p> <pre class="wiki">("maxlength", po::value&lt;double&gt;(&amp;MaxLength?)-&gt;default_value(.1, "0.1"), "Maximum edge length to keep.") </pre><p> This string is then used for the help output. I would recommend to use this approach. </p> <p> I attached a test case to show the usage of this functionality. Maybe documentation needs to be updated. </p> <p> Please comment. </p> </description> <category>Ticket</category> </item> <item> <author>s.ochsenknecht@…</author> <pubDate>Tue, 10 Nov 2009 13:43:11 GMT</pubDate> <title>cc set https://svn.boost.org/trac10/ticket/2994#comment:2 https://svn.boost.org/trac10/ticket/2994#comment:2 <ul> <li><strong>cc</strong> <span class="trac-author">s.ochsenknecht@…</span> added </li> </ul> Ticket s.ochsenknecht@… Tue, 10 Nov 2009 13:44:15 GMT <link>https://svn.boost.org/trac10/ticket/2994#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2994#comment:3</guid> <description> <p> BTW: For all other values (were no string representation of the default value is defined) boost::lexical_cast&lt;&gt;() is used. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Sascha Ochsenknecht</dc:creator> <pubDate>Fri, 20 Nov 2009 14:18:40 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/2994#comment:4 https://svn.boost.org/trac10/ticket/2994#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/57817" title="added test case, Fixes #2994">[57817]</a>) added test case, Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2994" title="#2994: Feature Requests: default value output precision (closed: fixed)">#2994</a> </p> Ticket