Too few decimals for floats
MySQL database connector for Python programming
Brought to you by:
adustman
The default Thing2Str converter outputs too few
decimals for floats:
Python 2.2.3 (#1, Jun 10 2003, 16:41:13)
[GCC 3.3 20030604 (Red Hat Linux 3.3-5)] on linux2
Type "help", "copyright", "credits" or "license" for more
information.
>>> import MySQLdb
>>> from math import pi
>>> db = MySQLdb.connect(...)
>>> print "%s" % db.literal(pi)
3.14159265359
>>> print "%.15g" % pi
3.14159265358979
>>>
Add a specialized converter that outputs at least 15
decimals which is what both Python and Mysql supports
for float/double precision (64 bit IEEE 754).
Logged In: YES
user_id=71372
will be in 0.9.3b3
Logged In: YES
user_id=71372
This has been fixed in the current CVS tree.