SQL SERVER 处理小数位数函数FU_DecimalDigits

alter FUNCTION FU_DecimalDigits
(
@FNum NVARCHAR(100) --
)
RETURNS nvarchar(100)
AS
/*作用:处理数值,保留有效小数位数
*/
begin
while right(@FNum,1) in ('0','.')
    begin
        set @FNum=left(@FNum,len(@FNum)-1)
    end
return @FNum
end
 

 

posted @ 2021-06-16 15:25  博客燕  阅读(293)  评论(0编辑  收藏  举报