I am using SQL Server 2008 express, any reason?? however, if i convert to decimal(6,4) is work. e.g. Select CONVERT(decimal(6,4),'1.1234'); thanks you.
我正在使用SQL Server 2008 express,有什么原因吗?但是,如果我转换成十进制(6,4)就是功。如选择转换(小数(6,4),“1.1234”);谢谢你。
2 个解决方案
#1
1
decimal(Precision, Scale). The Precision number control the maximum number of digits on the left side of the period. The Scale specifies the maximum number of digits on the right side.
小数(精度、规模)。精确数字控制在周期的左边的最大位数。Scale指定右侧的最大位数。
If you want 3 digits before decimal and 4 after decimal then
如果你想要3位数在小数点前,4位数在小数点后
rate decimal(7, 4)
#2
3
decimal(x,y)
x: total number of digits(max)
y: number of digits after decimal point(max)
thats why y<=x
#1
1
decimal(Precision, Scale). The Precision number control the maximum number of digits on the left side of the period. The Scale specifies the maximum number of digits on the right side.
小数(精度、规模)。精确数字控制在周期的左边的最大位数。Scale指定右侧的最大位数。
If you want 3 digits before decimal and 4 after decimal then
如果你想要3位数在小数点前,4位数在小数点后
rate decimal(7, 4)
#2
3
decimal(x,y)
x: total number of digits(max)
y: number of digits after decimal point(max)
thats why y<=x