Convert float to string before Decimal
To avoid rounding issue of float, we must rely on the Python string format. Closes #12738 --HG-- branch : 6.0
This commit is contained in:
1 parent
7f8fd4fafc
commit
5a2e57fd96
1 file changed
+1
-1
@@ -53,7 +53,7 @@ class NumberEntry(Gtk.Entry, Gtk.Editable):
|
||||
value = None
|
||||
if text not in ['-', self.__decimal_point]:
|
||||
try:
|
||||
value = Decimal(locale.atof(text))
|
||||
value = Decimal(str(locale.atof(text)))
|
||||
except (ValueError, InvalidOperation):
|
||||
return position
|
||||
if (value and self.__digits is not None
|
||||
|
||||
Reference in new issue
Block a user