我也来试:
function xtod(xiao:double):string;
var I,longfront,longall:integer;
str1,dstr:string;
const frontdot='佰拾亿仟佰拾万仟佰拾元';//这里可以由你加多几位
backdot='角分厘毫姑婶婆';//也可以加
begin
longfront:=length(inttostr(trunc(xiao)));
//取得小数点前数字长度
dstr:=copy(frontdot,length(frontdot)-longfront*2+1,longfront*2)+backdot;//取得总金额对应单位
str1:=floattostr(xiao);
Delete(str1,longfront+1,1);//删除小数点
longall:=length(str1);
for i:=1 to longalldo
case strtoint(str1) of
0:result:=result+'零'+copy(dstr,i*2-1,2);
1:result:=result+'壹'+copy(dstr,i*2-1,2);
2:result:=result+'贰'+copy(dstr,i*2-1,2);
3:result:=result+'叁'+copy(dstr,i*2-1,2);
4:result:=result+'肆'+copy(dstr,i*2-1,2);
5:result:=result+'伍'+copy(dstr,i*2-1,2);
6:result:=result+'陆'+copy(dstr,i*2-1,2);
7:result:=result+'柒'+copy(dstr,i*2-1,2);
8:result:=result+'捌'+copy(dstr,i*2-1,2);
9:result:=result+'玖'+copy(dstr,i*2-1,2);
end;
end;
//from okhai