Skip to content

Commit

Permalink
Quarterly report: fix quater column label
Browse files Browse the repository at this point in the history
A rounding error caused a wrongly labeled quarter column.
E.g. setting a start date of 1st Oct. labeled the column "Q3"
  • Loading branch information
humdingerb committed Aug 23, 2024
1 parent 9ed6e56 commit 8a34ed9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/CashFlowReport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ ReportWindow::ComputeCashFlow(void)
case SUBTOTAL_QUARTER:
{
char year[10];
int quarternumber = ((timestruct->tm_mon + 2) / 3) + 1;
int quarternumber = (ceil(timestruct->tm_mon / 3) + 1);
strftime(year, 10, "%Y", timestruct);
sprintf(columntitle, "Q%d %s", quarternumber, year);
break;
Expand Down

0 comments on commit 8a34ed9

Please sign in to comment.