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:
Cédric Krier committed 2023-11-14 00:53:52 +01:00
1 parent 7f8fd4fafc
commit 5a2e57fd96
1 file changed
+1 -1
+1 -1
View File
@@ -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