Sql Server 取小数点后两位,向上取整,向下取整,四舍五入

 

 

select 2.0983 [],convert(numeric(8,2),round(2.0983,2)) [取小数点后两位]
select 2.0983 [],cast(2.0983 as decimal(20,2)) [取小数点后两位]
select 2.0983 [],round(2.0983,0) [四舍五入取整截取]
select 2.0983 [],floor(2.0983) [向下取整截取]
select 2.0983 [],ceiling(2.0983) [向上取整截取]

 

posted @ 2022-01-07 10:21  小杨观世界  阅读(2988)  评论(0编辑  收藏  举报