function convert(money:real):string;
     var
     smallmode:string;
     bigchar,powerchar:string[2];
     power,dotpos,i:integer;     begin
      power:=-2;
      smallmode:=formatfloat('0.00',money);
      dotpos:=system.pos('.',smallmode);
      for i:=length(smallmode) downto 1 do begin
          if i=dotpos then continue;
          case strtoint(copy(smallmode,i,1))of
           1:bigchar:='壹';
           2:bigchar:='贰';
           3:bigchar:='叁';
           4:bigchar:='肆';
           5:bigchar:='伍';
           6:bigchar:='陆';
           7:bigchar:='柒';
           8:bigchar:='捌';
           9:bigchar:='玖';
           0:bigchar:='零';
       end;
       case power of
       -3:powerchar:='厘';
       -2:powerchar:='分';
       -1:powerchar:='角';
       0:powerchar:='元';
       1,5,9:powerchar:='拾';
       2,6,10:powerchar:='佰';
       3,7,11:powerchar:='仟';
       4,12:powerchar:='万';
       8:powerchar:='亿';
     end;
    inc(power);
    result:=bigchar+powerchar+result;
    end;
end; 

解决方案 »

  1.   

    多谢,能否将整个过程说一下,lable如何加?
      

  2.   


    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:='仟佰拾万仟佰拾元角分';
       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;