开发者

How to properly define the [float] data type in mysql

开发者 https://www.devze.com 2023-03-21 02:09 出处:网络
I defined (through PHPMYADMIN) a field with the float data type. When I try to insert a number as 78.556677099932222377 it will translate it to 79.

I defined (through PHPMYADMIN) a field with the float data type.

When I try to insert a number as 78.556677099932222377 it will translate it to 79.

开发者_Go百科How do I make it to save the correct number, at least 7 places after the decimal dot?


Open phpMyAdmin with structure option and define the float as:

FLOAT(23,19)

clear in this picture:

How to properly define the [float] data type in mysql


How do you define the float in phpMyAdmin

FLOAT(23,19)

when u declare the field you could use that above.

Better to go with Cygnusx1 and change to decimal

see MySQL numeric types

and also Problems with Float


DECIMAL is what you looking for.

ref:

SQL Decimal is used to specify the values in decimal datatype. The Decimal datatype can be of two types : Decimal (p) refers to floating point and Decimal fixed point (p,s). The DECIMAL data type can store decimal floating-point numbers up to a maximum of 32 significant digits and Decimal fixed point can store upto 16 significant digits.

0

精彩评论

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