Commit 3904779e authored by Jérome Perrin's avatar Jérome Perrin

simply use repr that have better precision than str


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34573 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e7faece5
......@@ -1650,13 +1650,10 @@ class FloatWidget(TextWidget):
float_value = float(value)
if precision not in (None, ''):
float_value = round(float_value, precision)
value = str(float_value)
# we use repr that have a better precision than str
value = repr(float_value)
except ValueError:
return value
else:
if 'e' in value:
# %f will not use exponential format
value = '%f' % float(original_value)
value_list = value.split('.')
integer = value_list[0]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment