您的实施存在两个问题。
值都被舍入到 2 位精度的原因是您明确将比例定义为 2。
此外,FLOAT 在 MySQL 中是一种不精确的数据类型。
要解决这两个问题,您应该使用具有适当精度和比例的 DECIMAL 数据类型。
例如,像这样:
CREATE TABLE `tblGeoCodes` (
`recNo` int(11) NOT NULL AUTO_INCREMENT primary key,
`longLocation` decimal(18,14) DEFAULT NULL,
`latLocation` decimal(18,14) DEFAULT NULL
);
例子:
mysql> CREATE TABLE `tblGeoCodes` (
-> `recNo` int(11) NOT NULL AUTO_INCREMENT primary key,
-> `longLocation` decimal(18,14) DEFAULT NULL,
-> `latLocation` decimal(18,14) DEFAULT NULL
-> );
Query OK, 0 rows affected (0.02 sec)
mysql>
mysql> insert into tblGeoCodes (longLocation,latLocation) values(-61.45859899999999 , 10.28289);
Query OK, 1 row affected (0.00 sec)
mysql>
mysql> select * from tblGeoCodes;
+-------+--------------------+-------------------+
| recNo | longLocation | latLocation |
+-------+--------------------+-------------------+
| 1 | -61.45859899999999 | 10.28289000000000 |
+-------+--------------------+-------------------+
1 row in set (0.00 sec)