按照你的update a set a=25.0/7780 where aid='001' 数据却变成: aid a 001 3.2133676090000001E-3好象还是不对啊?
update a set a=convert(numeric(10,4),25)/7780 where aid='001'有效数字自己控制
update a set a=convert(numeric(10,4), convert(numeric(10,4),25)/7780) where aid='001'
如果是update a set a=(25.0000)/(7780.0000) where aid='001' 怎么来更新?
update a set a=25/7780 where aid='001' 25/7780 两个都是整数,保留小数位的话需要进行显示转换,分子分母只要有一个保留小数即可如: update a set a=25*1.00000/7780 where aid='001' 或: update a set a=25.00000/7780 where aid='001' 或: update a set a=25/7780.00000 where aid='001'
对float型进行显示转换下,就好了!
为什么把7780换成7630就又会不对了。aid a 001 3.2765390000000002E-3
aid a
001 3.2133676090000001E-3好象还是不对啊?
怎么来更新?
25/7780 两个都是整数,保留小数位的话需要进行显示转换,分子分母只要有一个保留小数即可如:
update a set a=25*1.00000/7780 where aid='001'
或:
update a set a=25.00000/7780 where aid='001'
或:
update a set a=25/7780.00000 where aid='001'
001 3.2765390000000002E-3