转换中文数字
//将指定数字转换成汉字的函数,UpperWord(源数字,是否货币汉字,是否自动加位数);
function UpperWord(IDigital:integer;money:Boolean=false;AddBit:Boolean=false):string;
var SDigital,sWord,SReturn:string;
ITmp:integer;
begin
if Money then SWord:='零壹贰叁肆伍陆柒捌玖' else SWord:='零一二三四五六七八九';
SDigital:=inttostr(IDigital);
SReturn:='';
ITmp:=Length(SDigital);
while ITmp>0 do
begin
SReturn:=SReturn+copy(SWord,strtoint(copy(SDigital,1,1))*2+1,2);
if AddBit then
begin
if copy(SDigital,1,1)='0' then
if copy(SReturn,length(SReturn)-3,4)='零零' then SReturn:=copy(SReturn,1,length(SReturn)-2);
case ITmp of
2,6,10:if copy(SDigital,1,1)<>'0' then SReturn:=SReturn+'十';
3,7,11:if copy(SDigital,1,1)<>'0' then SReturn:=SReturn+'百';
4,8,12:if copy(SDigital,1,1)<>'0' then SReturn:=SReturn+'千';
5:if copy(SDigital,1,1)<>'0' then SReturn:=SReturn+'万' else (if copy(SReturn,length(SReturn)-3,2)='亿' then SReturn:=copy(SReturn,1,length(SReturn)-2) else SReturn:=copy(SReturn,1,length(SReturn)-2)+'万');
9:if copy(SDigital,1,1)<>'0' then SReturn:=SReturn+'亿' else SReturn:=copy(SReturn,1,length(SReturn)-2)+'亿';
end;
end;
SDigital:=copy(SDigital,2,255);
ITmp:=Length(SDigital);
end;
if AddBit then
while copy(SReturn,length(SReturn)-1,2)='零' do
SReturn:=copy(SReturn,1,length(SReturn)-2);
UpperWord:=SReturn;
end;