summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Src/StringUtil.cpp
diff options
context:
space:
mode:
authorJohn Peterson <jpeterson57@gmail.com>2009-09-03 20:00:09 +0000
committerJohn Peterson <jpeterson57@gmail.com>2009-09-03 20:00:09 +0000
commita69eb4301928bec4c55ae9ce0063211e74c545a2 (patch)
tree42bed841f50a25a570bce4eba7d7702f900ebe7d /Source/Core/Common/Src/StringUtil.cpp
parent2b1022f152ca422b8b1ff2054a01bd5b55b25009 (diff)
GUI: Added file monitor log
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4185 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/Common/Src/StringUtil.cpp')
-rw-r--r--Source/Core/Common/Src/StringUtil.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/Source/Core/Common/Src/StringUtil.cpp b/Source/Core/Common/Src/StringUtil.cpp
index 57cfe503b7..b6b65a3e90 100644
--- a/Source/Core/Common/Src/StringUtil.cpp
+++ b/Source/Core/Common/Src/StringUtil.cpp
@@ -439,23 +439,27 @@ int ChooseStringFrom(const char* str, const char* * items)
}
-// Thousand separator. Turns 12345678 into 12,345,678.
-std::string ThS(int Integer, bool Unsigned)
+// Thousand separator. Turns 12345678 into 12,345,678
+std::string ThS(int Integer, bool Unsigned, int Spaces)
{
// Create storage space
char cbuf[20];
// Determine treatment of signed or unsigned
if(Unsigned) sprintf(cbuf, "%u", Integer); else sprintf(cbuf, "%i", Integer);
- std::string sbuf = cbuf;
- for (u32 i = 0; i < sbuf.length(); ++i)
+ std::string Sbuf = cbuf;
+ for (u32 i = 0; i < Sbuf.length(); ++i)
{
if((i & 3) == 3)
{
- sbuf.insert(sbuf.length() - i, ",");
+ Sbuf.insert(Sbuf.length() - i, ",");
}
}
- return sbuf;
+
+ // Spaces
+ std::string Spc = "";
+ for (int i = 0; i < (Spaces - Sbuf.length()); i++) Spc += " ";
+ return Spc + Sbuf;
}
void NormalizeDirSep(std::string* str)