38位的10进制如何转换成16进制。具体怎样实现!如:25123622100303132235292210040235152810

解决方案 »

  1.   

    说的不清楚.是38位长的数字还是38长的字符串.有inttohex 看能不能用到.
      

  2.   

    function IntToHex(Const Value: Integer): string;
    const
      HexChars: array[0..15] of Char = '0123456789ABCDEF';
    var
      iTemp: Integer;
      i: Integer;
    begin
      Result := '';
      i := 0;
      while i<4 do
      begin
        case i of
          0: iTemp := Value shr 24 and $FF;
          1: iTemp := Value shr 16 and $FF;
          2: iTemp := Value shr 8 and $FF;
          3: iTemp := Value and $FF;
        end;
        Result := Result + HexChars[iTemp div 16];
        Result := Result + HexChars[iTemp mod 16];
        Inc(i);
      end;
    end;
    procedure TForm1.Button1Click(Sender: TObject);
    begin
       Edit2.Text := IntToHex(StrToInt(Edit1.Text)); 
    end;end.
      

  3.   

    lxbsweet 的fuction 无法实现,我也试验过类似的方法。
    38位的数字远远超过了整形数值的取值范围。