mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Bug
- Fixed a precision problem with average age on the summary report. The problem was that average age is calculated as the sum of all ages, divided by the count. The sum was already being stored as a double, to allow for very high values, but was being truncated to an int before being divided by the count. Classic precision mishandling.
This commit is contained in:
parent
e619f8c91d
commit
c27097e286
2 changed files with 2 additions and 1 deletions
|
@ -759,7 +759,7 @@ int handleReportSummary (std::string &outs)
|
|||
table.addCell (row, 0, (i->first == "" ? "(none)" : i->first));
|
||||
table.addCell (row, 1, countPending[i->first]);
|
||||
if (counter[i->first])
|
||||
table.addCell (row, 2, Duration ((int) sumEntry[i->first] / counter[i->first]).format ());
|
||||
table.addCell (row, 2, Duration ((int) (sumEntry[i->first] / (double)counter[i->first])).format ());
|
||||
|
||||
int c = countCompleted[i->first];
|
||||
int p = countPending[i->first];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue