有点麻烦,自己一个一个写啊 s:=1025; str:string; for i:=0 to length(s)-1 do begin //写一个1000 if s[i]=1 then str:=str+'一'; if s[i]=2 then str:=str+'一'; end;
var s:String; begin s:='10001025'; showmessage(copy(s,pos('1025',s),4)); end;
s:='10001025'; var i:integer; i:=Strtoint(copy(s,2,length(s)-1)); FUNCTION chineseje(Aje:Currency):string; var s_1,s_2:widestring; s_5:char; s_4:string; i:integer; mm:string; s_6,s_7:widestring; begin s_4:=format('%10d',[trunc(aje*100)]); s_1:='零壹贰叁肆伍陆柒捌玖'; s_2:='仟佰拾万仟佰拾元角分'; s_5:='0'; i:=1; mm:=''; WHILE i<=10 do begin s_5:=s_4[i]; IF s_5<>' ' then begin s_6:=s_1[ord(s_5)-ORD('0')+1]; s_7:=s_2[i]; IF (s_5='0') AND (i<>4) AND (i<>8) then s_7:=''; IF (copy(s_4,i,2)='00') OR ( (s_5='0') AND (i in [4,8,10])) then s_6:=''; mm:=mm+s_6+s_7; IF (s_4[i]='0') AND ((s_4[i+1]<>'0') AND (i in [4,8])) then mm:=mm+s_1[1]; END; inc(i); END ; IF s_5='0' then mm:=mm+'整'; result:=mm; end;
s:=1025;
str:string;
for i:=0 to length(s)-1 do
begin
//写一个1000
if s[i]=1 then str:=str+'一';
if s[i]=2 then str:=str+'一';
end;
var s:String;
begin
s:='10001025';
showmessage(copy(s,pos('1025',s),4));
end;
var i:integer;
i:=Strtoint(copy(s,2,length(s)-1));
FUNCTION chineseje(Aje:Currency):string;
var
s_1,s_2:widestring;
s_5:char;
s_4:string;
i:integer;
mm:string;
s_6,s_7:widestring;
begin
s_4:=format('%10d',[trunc(aje*100)]);
s_1:='零壹贰叁肆伍陆柒捌玖';
s_2:='仟佰拾万仟佰拾元角分';
s_5:='0';
i:=1;
mm:='';
WHILE i<=10 do
begin
s_5:=s_4[i];
IF s_5<>' ' then
begin
s_6:=s_1[ord(s_5)-ORD('0')+1];
s_7:=s_2[i];
IF (s_5='0') AND (i<>4) AND (i<>8) then
s_7:='';
IF (copy(s_4,i,2)='00') OR ( (s_5='0') AND (i in [4,8,10])) then
s_6:='';
mm:=mm+s_6+s_7;
IF (s_4[i]='0') AND ((s_4[i+1]<>'0') AND (i in [4,8])) then
mm:=mm+s_1[1];
END;
inc(i);
END ;
IF s_5='0' then
mm:=mm+'整';
result:=mm;
end;
非常完美噢,去书店看看吧:)