简体   繁体   中英

MySQL column type 'Double' - removes the digits after decimal

I need to insert values like below to a column with type Double

1.0
1.23
12.345
1234.5678
123456.1234567891

When I try to insert 123456.1234567891, it inserts only 123456.123456789 ('1' is missing in the end)

How do I fix this?

Doubles have a precision of only about 16 digits (52 bits). My guess here is that the '1' on the end is outside the range of that precision and is getting lost. Without moving to a different type, you will be unable to store it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM