22,209
社区成员
发帖
与我相关
我的任务
分享
-- 测试数据:#
if object_id('tempdb.dbo.#') is not null drop table #
create table #(f1 float)
insert into #
select 1.2345 union all
select 0.0852585 union all
select 0 union all
select 234.155544
select *, case f1 when 0 then '' else convert(varchar,f1,128) end s1 from #
/*
f1 s1
---------------------- ------------------------------
1.2345 1.2345
0.0852585 0.0852585
0
234.155544 234.155544
*/
declare @i float
set @i = 234.155544
select ltrim(cast(@i as decimal(38,10)))
/*****************
-----------------------------------------
234.1555440000
(1 行受影响)