From a69eb4301928bec4c55ae9ce0063211e74c545a2 Mon Sep 17 00:00:00 2001 From: John Peterson Date: Thu, 3 Sep 2009 20:00:09 +0000 Subject: GUI: Added file monitor log git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4185 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Common/Src/StringUtil.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'Source/Core/Common/Src/StringUtil.cpp') 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) -- cgit v1.2.3