[Erp5-report] r34573 jerome - /erp5/trunk/products/Formulator/Widget.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Apr 15 10:45:33 CEST 2010
Author: jerome
Date: Thu Apr 15 10:45:30 2010
New Revision: 34573
URL: http://svn.erp5.org?rev=34573&view=rev
Log:
simply use repr that have better precision than str
Modified:
erp5/trunk/products/Formulator/Widget.py
Modified: erp5/trunk/products/Formulator/Widget.py
URL: http://svn.erp5.org/erp5/trunk/products/Formulator/Widget.py?rev=34573&r1=34572&r2=34573&view=diff
==============================================================================
--- erp5/trunk/products/Formulator/Widget.py [utf8] (original)
+++ erp5/trunk/products/Formulator/Widget.py [utf8] Thu Apr 15 10:45:30 2010
@@ -1650,13 +1650,10 @@
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]
More information about the Erp5-report
mailing list