在mysql中想保存类似“104.0658093”这样的值应该用什么类型的列?怎么感觉都有点不够长啊?

解决方案 »

  1.   

    你是怎样定义的?
    DECIMAL[(M[,D])] [UNSIGNED] [ZEROFILL] A packed “exact” fixed-point number. M is the total number of digits (the precision) and D is the number of digits after the decimal point (the scale). The decimal point and (for negative numbers) the ‘-’ sign are not counted in M. If D is 0, values have no decimal point or fractional part. The maximum number of digits (M) for DECIMAL is 65. The maximum number of supported decimals (D) is 30. If D is omitted, the default is 0. If M is omitted, the default is 10. 
      

  2.   

    用DECIMAL就行了,如果不参与计算,则也可以用字符型。
      

  3.   

    decimal是专为此类就用而设计的
      

  4.   

    DECIMAL(10,7) 就解决了你只能打5个小数的问题。