diff --git a/gramps/gen/config.py b/gramps/gen/config.py index e6de98ba3fc..f7a5f84c607 100644 --- a/gramps/gen/config.py +++ b/gramps/gen/config.py @@ -331,6 +331,7 @@ def emit(key): register("preferences.family-relation-type", 3) # UNKNOWN register("preferences.age-display-precision", 1) register("preferences.age-after-death", True) +register("preferences.age-rounded-year", True) register("preferences.cite-plugin", "cite-legacy") register("colors.scheme", 0) diff --git a/gramps/gen/lib/date.py b/gramps/gen/lib/date.py index b38542a354e..8820dbb9d0f 100644 --- a/gramps/gen/lib/date.py +++ b/gramps/gen/lib/date.py @@ -457,7 +457,9 @@ def _format(self, diff_tuple, dlocale=glocale): ).format(number_of=diff_tuple[0]) detail += 1 if self.precision == detail: - if diff_tuple[1] >= 6: # round up years + if diff_tuple[1] >= 6 and config.get( + "preferences.age-rounded-year" + ): # round up years # Translators: leave all/any {...} untranslated retval = ngettext( "{number_of} year", "{number_of} years", diff_tuple[0] + 1 diff --git a/gramps/gui/configure.py b/gramps/gui/configure.py index 50cb1797ef8..943c57aa4cf 100644 --- a/gramps/gui/configure.py +++ b/gramps/gui/configure.py @@ -1564,6 +1564,17 @@ def add_data_panel(self, configdialog): grid.attach(lwidget, 1, row, 1, 1) grid.attach(obox, 2, row, 2, 1) + row += 1 + # Display rounded year + self.add_checkbox( + grid, + _("Round the year"), + row, + "preferences.age-rounded-year", + start=2, + stop=3, + ) + row += 1 # Display ages for events after death self.add_checkbox(