开发者

Navicat MySQL - Import feature screwing up my numbers

开发者 https://www.devze.com 2023-02-06 10:05 出处:网络
I\'ve been wrestling with this problem for quite a while now. A client has given me 4 spreadsheet files, all of which are just fine. Not a thing wrong with them.

I've been wrestling with this problem for quite a while now.

A client has given me 4 spreadsheet files, all of which are just fine. Not a thing wrong with them.

They just have stuf开发者_运维技巧f like Part Numbers, Item names, and Prices.

Prices look something like this: 7.99 or 0.58

But when I import the spreadsheets into a new, empty database table using Navicat for MySQL, the numbers get screwed up!

Most of them look like this now: 7.9986 and 0.0580 etc etc etc!

And because there are tens of thousands of prices, and because I don't know the pricing for all of their products, I don't know sometimes which is the real price, and which is a wrong one.

I have no idea what's causing this problem.

Any help at all is greatly appreciated!

Thank you


This sounds like it could be a precision problem. What data type are you using for the price column in the "new, empty" table? Try using DECIMAL or NUMERIC rather than (say) FLOAT, if applicable.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号