2013-05-12 02:02:12 +00:00
|
|
|
#pragma once
|
2009-11-26 13:56:30 +00:00
|
|
|
|
|
|
|
#include <string>
|
2014-05-26 04:43:49 +00:00
|
|
|
#include <sstream>
|
2009-11-26 13:56:30 +00:00
|
|
|
|
|
|
|
template <typename StringType>
|
|
|
|
static StringType TimeToString(double time)
|
|
|
|
{
|
2013-05-12 02:02:12 +00:00
|
|
|
StringType separator;
|
|
|
|
separator += ':';
|
|
|
|
unsigned int secs = static_cast<unsigned int>(time) % 60;
|
|
|
|
unsigned int mins = static_cast<unsigned int>(time) / 60;
|
2013-10-15 02:37:50 +00:00
|
|
|
std::basic_stringstream<typename StringType::value_type> result;
|
2013-05-12 02:02:12 +00:00
|
|
|
result << mins << separator;
|
|
|
|
result.width(2);
|
|
|
|
result.fill('0');
|
|
|
|
result << secs;
|
|
|
|
return result.str();
|
2009-11-26 13:56:30 +00:00
|
|
|
}
|