From 245faf8ef108ab45b6276848abe7462109194c36 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Sun, 20 Jun 2004 06:27:37 +0000 Subject: [PATCH] Cambio de formato. --- util/charstat.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/util/charstat.cpp b/util/charstat.cpp index 369cffe..ae96135 100644 --- a/util/charstat.cpp +++ b/util/charstat.cpp @@ -23,17 +23,18 @@ public: os.width(4); os.fill(' '); if (isgraph(p.first)) { - os << p.first; - } else { - std::ostringstream oss; - oss << "0x"; - oss.width(2); - oss.fill('0'); - oss.setf(std::ios::hex, std::ios::basefield); - oss << int(p.first); - os << oss.str(); + os << p.first << " ["; } - os << " (" << double(p.second) / total * 100 << "%)\n"; + std::ostringstream oss; + oss << "0x"; + oss.width(2); + oss.fill('0'); + oss.setf(std::ios::hex, std::ios::basefield); + oss << int(p.first); + os << oss.str() << ":" << unsigned(p.first); + if (isgraph(p.first)) os << "]"; + os << " (" << double(p.second) / total * 100 << "% : " + << unsigned((double(p.second) / total) * 4294967296ull) << ")\n"; } }; -- 2.43.0