开发者

what data type should I use for storing small decimal value

开发者 https://www.devze.com 2023-01-02 20:58 出处:网络
开发者_如何学编程what data type should I use to store small decimal value? Ranging from -50.00 to 50.00?
开发者_如何学编程

what data type should I use to store small decimal value? Ranging from -50.00 to 50.00?

Thanks,


Try DECIMAL(4,2) which would allow you to store -99.99 to 99.99

MSDN documentation for DECIMAL.
The 4 represents the precision which is the total number of digits that can be stored (to the left and right of the decimal place).
The 2 represents the scale which is the number of digits that can appear after the decimal place.


Look at

http://msdn.microsoft.com/en-us/library/ms187746.aspx

Basically you need two points before the decimal and 2 after?

columnname precision(4)
0

精彩评论

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

关注公众号