Skip to content
Snippets Groups Projects
Commit bb59f7c6 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

Respect required maxlen and prec in double::to_s

parent 072cf3d8
No related branches found
No related tags found
No related merge requests found
......@@ -10,8 +10,10 @@
#include <string>
#include <vector>
#include <cmath>
#include <boost/format.hpp>
using namespace std;
using boost::format;
#include "defs.hpp"
#include "ptr.hpp"
......@@ -48,7 +50,9 @@ string CObjInt::to_s( int maxlen, int minlen, int prec ) const
string CObjDbl::to_s( int maxlen, int minlen, int prec ) const
{
return S(val);
string form = str( format( "%%#%i.%ig" ) % maxlen % prec );
string ret = str( format( form ) % val );
return ret;
}
//! Returns textual representation of the class instance, for debugging.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment