summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-01-08 14:25:08 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-01-08 14:25:08 +0000
commit901ebf3c87b1fdcbd2fa5e3ac0afeada14c66597 (patch)
tree3f57677edb7e88c96f3475296c677aeb7720a01b
parent965ee51d748e1cbf25edfc85b45358a8935ef99f (diff)
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
-rw-r--r--src/modules/m_spanningtree.cpp10
1 files changed, 7 insertions, 3 deletions
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++)