请问如何将数字的小写转为中文的大写
例:0123456789转为零壹贰叁肆伍陆柒捌玖
(注:只是数字的转换,不是金额转换)

解决方案 »

  1.   


    function IntToHZ(Num: Integer): String;
    const
      HZString : array [0..9] of String = ('零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖');
    begin
      Result := '';
      repeat
        Result := HZString[Num mod 10] + Result;
        Num := Num div 10;
      until Num = 0;
    end;procedure TForm1.FormCreate(Sender: TObject);
    begin
      ShowMessage (IntToHZ(1234567890));
    end;
      

  2.   

    s:='1334340123456789'
    str:='';
    for n:=1 to m do
    begin
      i:=strtoint(s[n]);
      case i of
      0:str:=str+'零';
      1:str:=str+'壹;
      2:str:=str+'贰';
      3:str:=str+'叁';
      4:str:=str+'肆';
      5:str:=str+'伍';
      6:str:=str+'陆';
      7:str:=str+'柒';
      8:str:=str+'捌';
      9:str:=str+'玖;
      end;
    end;