Convert float integer to integer before Decimal

To avoid having a decimal trailing 0 which fails 0 digits validation.

Closes #12761

--HG--
branch : 6.0
This commit is contained in:
Cédric Krier
2023-11-20 12:33:34 +01:00
parent 90181c3c43
commit 5b7f8e2be3
+4 -1
View File
@@ -53,7 +53,10 @@ class NumberEntry(Gtk.Entry, Gtk.Editable):
value = None
if text not in ['-', self.__decimal_point]:
try:
value = Decimal(str(locale.atof(text)))
value = locale.atof(text)
if value.is_integer():
value = int(value)
value = Decimal(str(value))
except (ValueError, InvalidOperation):
return position
if (value and self.__digits is not None