34,870
社区成员




select round('1.67789',2,1)
/*
1.67*/
select cast(round(1.67789,2,1) as numeric(9,2))
select cast(round(1.67789,2,1) as numeric(9,2))
select (SUBSTRING('1.67789',1,4))
select substring(cast(1.67789 as varchar(10)),1,charindex('.',1.67789)+2)
select cast(floor(1.67789*100)/100 as decimal(6,2))
select left(1.6789,4)
select convert(decimal(10,2),floor('1.67789'*100)/100)
declare @v decimal(10,5)
set @v=1.67789
select convert(decimal(10,2),floor(@v*100)/100)
/*
---------------------------------------
1.67
(1 行受影响)
*/
select cast('1.67789' as decimal(6,2))
---------------------------------------
1.68
(1 row(s) affected)