- Fixed bug #720, so that when the 'info' report renders total active time,
  it uses a lossless format (thanks to Bernhard B).
This commit is contained in:
Paul Beckingham 2011-08-23 22:15:00 -04:00
parent 89d3b4e805
commit 2f60bdf9d0
6 changed files with 44 additions and 2 deletions

View file

@ -283,6 +283,22 @@ std::string Duration::formatCompact () const
return std::string (formatted);
}
////////////////////////////////////////////////////////////////////////////////
std::string Duration::formatPrecise () const
{
char formatted[24];
int days = mSecs / 86400;
int hours = (mSecs % 86400) / 3600;
int minutes = (mSecs % 3600) / 60;
int seconds = mSecs % 60;
if (days > 0) sprintf (formatted, "%s%dd %d:%02d:%02d", (mNegative ? "-" : ""), days, hours, minutes, seconds);
else sprintf (formatted, "%s%d:%02d:%02d", (mNegative ? "-" : ""), hours, minutes, seconds);
return std::string (formatted);
}
////////////////////////////////////////////////////////////////////////////////
bool Duration::operator< (const Duration& other)
{