Converting SQL FLOAT to SQL INT, lost data

前端 未结 2 1406
渐次进展
渐次进展 2021-01-17 22:05

I\'m having some problems with converting some data stored in a FLOAT datatype to data stored in an INT datatype. The below example illustrates my problem:

D         


        
2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-17 22:44

    This is common behaviour for float data type due to specificity of float on computers. Use decimal (number) data type with fixed digits after decimal point. For example, decimal(10, 6).

提交回复
热议问题