日期:2014-05-17 浏览次数:20645 次
-- ============================================= -- Author: Author,qianjin036a -- Create date: Create Date,06/14/2008 02:27:17 -- Description: Description,Arabic numerals to English -- ============================================= CREATE FUNCTION Digit2English ( @arabia decimal(38,17) ) RETURNS varchar(1000) AS BEGIN declare @atoe table(a int,e varchar(10)) insert into @atoe select 0,'zero' union all select 1,'one' union all select 2,'two' union all select 3,'three' union all select 4,'four' union all select 5,'five' union all select 6,'six' union all select 7,'seven' union all select 8,'eight' union all select 9,'nine' declare @integer bigint,@trillion int,@billion int,@million int,@thousand int,@hundred int,@english varchar(1000) select @integer=@arabia,@english='' select @trillion=@integer % 1000000000000000/1000000000000,@billion=@integer % 1000000000000/1000000000, @million=@integer % 1000000000/1000000,@thousand=(@integer % 1000000)/1000,@hundred=(@integer % 1000) if @trillion>0 set @english=@english + dbo.ThreeDigit(@trillion) + 'trillion ' if @billion>0 set @english=@english + dbo.ThreeDigit(@billion) + trust_bs,