diff --git a/qt/aqt/deckconf.py b/qt/aqt/deckconf.py index b0c4e21ea..4b4f133df 100644 --- a/qt/aqt/deckconf.py +++ b/qt/aqt/deckconf.py @@ -3,6 +3,8 @@ # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html from operator import itemgetter +from typing import Union + import aqt from anki.consts import NEW_CARDS_RANDOM from anki.lang import _, ngettext @@ -165,7 +167,13 @@ class DeckConf(QDialog): ################################################## def listToUser(self, l): - return " ".join([str(x) for x in l]) + def num_to_user(n: Union[int, float]): + if n == round(n): + return str(int(n)) + else: + return str(n) + + return " ".join(map(num_to_user, l)) def parentLimText(self, type="new"): # top level?