From: mtk Date: Tue, 18 Aug 2009 16:48:33 +0000 (+0000) Subject: fix alignment X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=7cbd4fb1cbf61414520ae991966f6fcc9eaa2846;p=senf.git fix alignment git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1299 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Utils/Statistics.cc b/Utils/Statistics.cc index 979236e..259d4a7 100644 --- a/Utils/Statistics.cc +++ b/Utils/Statistics.cc @@ -85,24 +85,24 @@ senf::StatisticsBase::output(unsigned n) // char *format_eng( float f) { - static buf[16]; + static char buf[16]; if( f > 0){ int n = 0; - while( f > 1000.0f){ + while( f >= 1000.0f){ f /= 1000.f; n+=3; } - sprintf( buf, " %3.2fe%03d", f, n); + sprintf( buf, " %3.2fe%+03d", f, n); } else if( f < 0){ int n = 0; - while( f < 1000.0f){ + while( f <= -1000.0f){ f *= 1000.f; n+=3; } - sprintf( buf, "-%3.2fe%03d", f, n); + sprintf( buf, "-%3.2fe%+03d", f, n); } else{ sprintf( buf, " 0.00"); @@ -115,8 +115,8 @@ char *format_eng( float f) prefix_ void senf::StatisticsBase::consoleList(unsigned level, std::ostream & os) const { - os << boost::format("%s%-5d%|15t| %12g %12g %12g\n") - % std::string(2*level,' ') % rank() % min() % avg() % max(); + os << boost::format("%s%-5d%|15t| %12s %12s %12s\n") + % std::string(2*level,' ') % rank() % format_eng(min()) % format_eng(avg()) % format_eng(max()); { OutputMap::const_iterator i (outputs_.begin()); OutputMap::const_iterator i_end (outputs_.end());