I BELIEVE I CAN

加油,努力,奋斗!!

导航

SQL 语句,类型转换

declare @f float;
declare @i int;
set @f = 123.789;
--set @i = convert(int, @f)
--set @i = cast(@f as int)

--set @i = ROUND(@f, 0, 1);//直接截取
set @i = ROUND(@f, 0); //四舍五入
select @i

posted on 2013-01-23 13:28  朱小能  阅读(141)  评论(0编辑  收藏  举报