//memo类型控件,值应该为"[bigsum]",代码如下
begin
moneys1:='零壹贰叁肆伍陆柒捌玖';
moneys2:='圆拾佰仟万拾佰仟亿';
pursum:=int([selllog."购电金额"]);
bigsum:='';
if pursum>=100000000 then
bigsum:='金额太多'
else
begin
tint:=1;
oldint:=0;
while pursum>0 do
begin
if not ((pursum mod 10 =0) and (length(bigsum)>0)and (oldint=0))then
begin
oldint:=pursum mod 10;
bigsum:=copy(moneys1,oldint*2+1,2)+copy(moneys2,tint*2-1,2)+bigsum;
end;
inc(tint);
pursum:=int(pursum/10);
end;
if (length(bigsum)>4) and (copy(bigsum,1,2)='零') then
bigsum:=copy(bigsum,5,length(bigsum)-4);
pursum:=frac([selllog."购电金额"])*100 ;
if (pursum mod 10 = 0) and (pursum / 10 mod 10 = 0) then
bigsum:=bigsum+'整'
else
bigsum:=bigsum+copy(moneys1,(pursum / 10 mod 10)*2+1,2)+'角'+copy(moneys1,(pursum mod 10)*2+1,2)+'分';
end;
end