gramps icon indicating copy to clipboard operation
gramps copied to clipboard

Remove rounding when formatting a span

Open DaveSch-gramps opened this issue 3 years ago • 5 comments

Removes the +1 when the Age precision is set to 1 (Years) and the month is >= 6

Bug #12422

DaveSch-gramps avatar Oct 10 '21 17:10 DaveSch-gramps

This proposed fix reverts the change made for bug #8765.

The issue is that when calculating the length of a span, "about 1900" is taken as "1 Jan 1900" instead of a mid-point. This leads to the span "May 1900" to "about 1901" being displayed as "0 years" instead of "1 year" which may appear more reasonable.

Nick-Hall avatar Feb 17 '22 23:02 Nick-Hall

I just did a test

Birth = "May 1900" Death = "about 1901"

about defined with default 50 years PR 1301 NOT applied

Years = about 8 months Years, Months = about 8 months Years, Months, Days = about 8 months

PR 1301 applied

Years = about 8 months Years, Months = about 8 months Years, Months, Days = about 8 months

With PR 1301 still applied

Birth = "May 1900" Death = "about 1950"

Years = about 49 years

All correct calculations

But going back to to my exact date scenario, with PR1301 not applied

Date of Birth: 1909-12-12 Date of Death: 1993-11-03

Age: 83y, 10m, 22d Age: 83y, 10m Age: 84y

My relative was not 84 when she died.

DaveSch-gramps avatar Feb 18 '22 01:02 DaveSch-gramps

The argument made in the original bug report (#8765) was that an incomplete date such as "1900" was on average more likely to represent an event happening nearer to 1 Jul 1900 than 1 Jan 1900.

The fix caused other issues though. With two exact dates the age is rounded up which is unexpected in some countries. In England, using the example above, we would refer to a person as 83 years old even if they had lived for 83y, 10m, 22d.

However, this may not be the case in all countries, so perhaps we should make this an option as @SNoiraud suggests in bug report #12422.

Nick-Hall avatar Feb 18 '22 18:02 Nick-Hall

Personally, I use Year, Month, Day as my setting but I did notice it was rounding up when I first migrated to Gramps. Odd that the setting in Preferences is "Age display precision:"

I have no strong opinion that the code needs to be changed. If you (and/or others) feel this pull should be closed, I will not be disappointed.

DaveSch-gramps avatar Feb 18 '22 19:02 DaveSch-gramps

In general, rounding a span seems like a good idea. When the span represents an age, then rounding may not be appropriate and perhaps should be made optional.

I'll leave this open for now and think about it further.

Nick-Hall avatar Mar 16 '22 23:03 Nick-Hall

Closing PR in favor of @SNoiraud 's PR

https://github.com/gramps-project/gramps/pull/1615

DaveSch-gramps avatar Nov 02 '23 11:11 DaveSch-gramps