Skip to content

Commit 0901891

Browse files
sir-sigurdmethane
authored andcommitted
Use shorter format for float converter (#273)
1 parent 777b74f commit 0901891

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

MySQLdb/converters.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ def Unicode2Str(s, d):
6666
return s.encode()
6767

6868
def Float2Str(o, d):
69-
return '%.16e' % o
69+
s = repr(o)
70+
if 'e' not in s:
71+
s += 'e0'
72+
return s
7073

7174
def None2NULL(o, d):
7275
"""Convert None to NULL."""

0 commit comments

Comments
 (0)