diff --git a/pub/lib/obj.cpp b/pub/lib/obj.cpp index ee636f94052488b2c1267f436d63a7331c6fb842..4f9abef3ec2d3f3d88e944ed5aa7ae6f64fe9aeb 100644 --- a/pub/lib/obj.cpp +++ b/pub/lib/obj.cpp @@ -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.