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
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