diff options
author | Thomas Keil <tkeil (at) datacrystal (dot) de> | 2007-05-01 13:44:09 +0000 |
---|---|---|
committer | Thomas Keil <tkeil (at) datacrystal (dot) de> | 2007-05-01 13:44:09 +0000 |
commit | a7353164a339d29e3534b5534171175ee679a360 (patch) | |
tree | de93dfcee3cc56468c4d7834a4b26d4529c5b6eb /tools.cpp | |
parent | b3a350b379c46e4c8b56415fadf07fb7c9749621 (diff) | |
download | vdr-plugin-live-a7353164a339d29e3534b5534171175ee679a360.tar.gz vdr-plugin-live-a7353164a339d29e3534b5534171175ee679a360.tar.bz2 |
Added function ZeroPad to pad numbers with leading zeroes, e.g. 5 -> 05
Diffstat (limited to 'tools.cpp')
-rw-r--r-- | tools.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -1,4 +1,5 @@ #include <stdexcept> +#include <iomanip> #include <tnt/ecpp.h> #include <tnt/htmlescostream.h> #include <tnt/httprequest.h> @@ -8,6 +9,7 @@ #include "setup.h" #include "tools.h" + using namespace std; using namespace tnt; @@ -121,4 +123,12 @@ string StringTrim(string const& str) return res; } +string ZeroPad(int number) +{ + ostringstream os; + os << setw(2) << setfill('0') << number; + return os.str(); +} + + } // namespace vdrlive |