From 901ebf3c87b1fdcbd2fa5e3ac0afeada14c66597 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 8 Jan 2006 14:25:08 +0000 Subject: Changed printf specifiers in map to right-align digits git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2737 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/modules/m_spanningtree.cpp') diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index ea5d0664a..2f83916ac 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -2468,7 +2468,9 @@ class ModuleSpanningTree : public Module memset(spacer,' ',40); if ((40 - Current->GetName().length() - depth) > 1) { spacer[40 - Current->GetName().length() - depth] = '\0'; - } else { + } + else + { spacer[5] = '\0'; } @@ -2477,10 +2479,12 @@ class ModuleSpanningTree : public Module if (clientlist.size() == 0) { // If there are no users, WHO THE HELL DID THE /MAP?!?!?! percent = 0; - } else { + } + else + { percent = ((float)Current->GetUserCount() / (float)clientlist.size()) * 100; } - snprintf(text, 80, "%s %s%d [%.2f%%]", Current->GetName().c_str(), spacer, Current->GetUserCount(), percent); + snprintf(text, 80, "%s %s%5d [%3.2f%%]", Current->GetName().c_str(), spacer, Current->GetUserCount(), percent); strlcpy(&matrix[line][depth],text,80); line++; for (unsigned int q = 0; q < Current->ChildCount(); q++) -- cgit v1.2.3