当小数点后面是4个0,例如1.0000
怎么把后面的四个0去掉,变成1
只有当小数位后都是4个0的情况,1.0001则不变
------解决方案--------------------------------------------------------
select case when (round(1.0001,4)=1.0001) then floor(1.0001) else round(1.0001,0) end
------解决方案--------------------------------------------------------
select case
when A>0 then
case A-floor(A)
when 0 then floor(A)
else A
end
when A<0 then
case A-ceiling(A)
when 0 then ceiling(A)
else A
end
from XXXXXXXXXXxx
------解决方案--------------------------------------------------------
------解决方案--------------------------------------------------------
select @a = 1.0001
case charindex('[^0]',substring(convert(varchar(4),@a),3,4)) then @a else
round(@a,0) end