--去最后一个零
if @result like '%零'
begin
select @result = substring( @result , 1,datalength(@result)-2)
select @result = ltrim(rtrim(@result))
end
select @result
end
如果是0 ,自己可以加一句判断 ,怎么返回看自己要求
if @convmoney =0
begin
select '零元整'
return
end
liugr3988 回复于:2003-09-23 16:13:04
很好,顶!
Blackrose 回复于:2003-09-23 21:50:08
A.
1> sp_convertmoney 0.111
2> go
Msg 241, Level 16, State 2:
Server 'LOCAL', Procedure 'sp_convertmoney':
Scale error during implicit conversion of NUMERIC value '0.111' to a NUMERIC
field.
是不是考虑添加一点四舍五入(可以选择)的功能,或者一点容错...
B.
最大好像就是
玖拾玖亿玖仟玖佰玖拾玖万玖仟玖佰玖拾玖元玖角玖分
不错,算法没有仔细看,功能还是good!!!!
zhangyh123 回复于:2003-09-24 09:17:41
[quote:96e79aae65="Blackrose"]A.
1> sp_convertmoney 0.111
2> go
Msg 241, Level 16, State 2:
Server 'LOCAL', Procedure 'sp_convertmoney':
Scale error during implicit conversion of NUMERIC value '0.111' to a NUMERIC
fie..........[/quote:96e79aae65]