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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user