Use double instead of float to store Float fields in MySQL

The precision of MySQL float is not enough to handle all Python floats.
From http://docs.python.org/tutorial/floatingpoint.html:
"...almost all platforms map Python floats to IEEE-754 “double precision”"
This commit is contained in:
Cédric Krier committed 2010-03-11 12:02:29 +01:00
1 parent 3537d7fc4e
commit 596c8fce39
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -55,7 +55,7 @@ class Float(fields.Float):
@staticmethod
def sql_type(field):
return ('float', 'float')
return ('double', 'double')
class Numeric(fields.Numeric):
+1 -1
View File
@@ -175,7 +175,7 @@ class TableHandler(TableHandlerInterface):
('varchar', 'text'),
('text', 'varchar'),
('date', 'timestamp'),
('bigint', 'float'),
('bigint', 'double'),
('int', 'bigint'),
('tinyint', 'bool'),
('decimal', 'numeric'),