开发者

What data type for value 11.1234 in mysql?

I am wondering what data type I should use for storing 11.1234 in mySql?

I am not sure if I should use varchar or int. There is a开发者_C百科lso some decimal data types.


FLOAT or DECIMAL is probably best.

From the MySQL manual:

The FLOAT and DOUBLE data types are used to represent approximate numeric data values [...] The DECIMAL and NUMERIC data types are used to store exact numeric data values. In MySQL, NUMERIC is implemented as DECIMAL. These types are used to store values for which it is important to preserve exact precision, for example with monetary data.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜