function xd(xx:currency):string;
var
dx,ws:string;
i,cd:integer;
int:currency;
begin
int:=trunc((abs(xx)+0.005)*100);
{在“厘”上4舍5入后去掉小数点}
cd:=length(currtostr(int));
{取得数字的长度,跟据此长度即可判断位数}
dx:='零壹贰叁肆伍陆柒捌玖';
ws:='分角元拾佰仟万拾佰仟亿拾佰仟';
{位数}
Result:= ' ';
i:=1;
while i<=cddo
begin
Result:=Result+copy(dx,strtoint(copy(currtostr
(int),i,1))*2+1,2);
{取数字的大写}
Result:=Result+copy(ws,(cd-i)*2+1,2);
{加上数字的位数}
i:=i+1;
end
end