函数是没有的,不过之前有一位仁兄写的://看我的无限进制转换 
//pas 
unit DigitUnit; 
 
interface 
 
uses 
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 
  StdCtrls, Spin; 
 
type 
  TForm1 = class(TForm) 
    Button1: TButton; 
    Edit1: TEdit; 
    Edit2: TEdit; 
    Button2: TButton; 
    SpinEdit1: TSpinEdit; 
    procedure Button1Click(Sender: TObject); 
    procedure Button2Click(Sender: TObject); 
  private 
    { Private declarations } 
  public 
    { Public declarations } 
  end; 
 
var 
  Form1: TForm1; 
 
implementation 
 
{$R *.DFM} 
 
function Power(Base, Exponent: Integer): Integer; 
var 
  I: Integer; 
begin 
  Result := 1; 
  for I := 1 to Exponent do 
    Result := Result * Base; 
end; { Power } 
 
const 
  cScaleChar = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'; 
 
function DigitToInt(mScale: Byte; mDigit: string): Integer; 
var 
  I, L: Integer; 
begin 
  Result := 0; 
  L := Length(mDigit); 
  for I := L downto 1 do 
    Result := Result + Pred(Pos(mDigit[I], cScaleChar)) * Power(mScale, L - I); 
end; { DigitToInt } 
 
function IntToDigit(mScale: Byte; mInt: Integer): string; 
var 
  I, J: Integer; 
begin 
  Result := ''; 
  I := mInt; 
  while (I >= mScale) do begin 
    J := I mod mScale; 
    Result := Copy(cScaleChar, Succ(J), 1) + Result; 
    I := I div mScale; 
  end; 
  Result := Copy(cScaleChar, Succ(I), 1) + Result; 
end; { IntToDigit } 
 
procedure TForm1.Button1Click(Sender: TObject); 
begin 
  Edit2.Text := IntToStr(DigitToInt(SpinEdit1.Value, Edit1.Text)); 
end; 
 
procedure TForm1.Button2Click(Sender: TObject); 
begin 
  Edit1.Text := IntToDigit(SpinEdit1.Value, StrToIntDef(Edit2.Text, 0)); 
end; 
 
end. 
 
//dfm 
object Form1: TForm1 
  Left = 192 
  Top = 107 
  Width = 409 
  Height = 97 
  Caption = 'Form1' 
  Color = clBtnFace 
  Font.Charset = DEFAULT_CHARSET 
  Font.Color = clWindowText 
  Font.Height = -11 
  Font.Name = 'MS Sans Serif' 
  Font.Style = [] 
  OldCreateOrder = False 
  PixelsPerInch = 96 
  TextHeight = 13 
  object Button1: TButton 
    Left = 184 
    Top = 32 
    Width = 75 
    Height = 25 
    Caption = 'Button1' 
    TabOrder = 0 
    OnClick = Button1Click 
  end 
  object Edit1: TEdit 
    Left = 136 
    Top = 8 
    Width = 121 
    Height = 21 
    TabOrder = 1 
    Text = 'Edit1' 
  end 
  object Edit2: TEdit 
    Left = 272 
    Top = 8 
    Width = 121 
    Height = 21 
    TabOrder = 2 
    Text = 'Edit2' 
  end 
  object Button2: TButton 
    Left = 272 
    Top = 32 
    Width = 75 
    Height = 25 
    Caption = 'Button2' 
    TabOrder = 3 
    OnClick = Button2Click 
  end 
  object SpinEdit1: TSpinEdit 
    Left = 8 
    Top = 8 
    Width = 121 
    Height = 22 
    MaxValue = 255 
    MinValue = 2 
    TabOrder = 4 
    Value = 0 
  end 
end试一下

解决方案 »

  1.   

    IntToBin
    IntToHex
    BinToHex
    HexToBin
      

  2.   

    答erp2(天涯劍):
        也许我问的是不太高明,比不得阁下如此聪明高素质的人,但我问一个我不知道的问题有错吗?我更不明白,你怎能这样随意、无端地给别人冠以骗分的美名,我问一个问题,能骗谁的分
    子?我异常愤怒!“我希望以后这类骗分的问题少一点”,你以为你是谁,正义光明的化身吗?能
    够任意去评判别人吗?
        你,这个卑鄙虚伪、厚颜无耻的天涯剑,最后,我只想很认真很认真地对你说一句:你他妈混蛋!
      

  3.   

    IntToBin  10 to 2
    IntToHex  10 to 16
    BinToHex  2  to 16
    HexToBin  16 to  2
      

  4.   

    to  Liusp(夜深千帐灯) 
    骂得好 已经有不少人在骂他了 呵呵 你可以查看帖子
    http://www.csdn.net/Expert/Topicview.asp?id=519449
      

  5.   

    我也来加一句吧 
    Format('%*.*X',[6,0,CAP]);//CAP为整型    十进制整型转换为十六进制表示的字符型
    StrToInt('$'+edit1.text);//十六进制的字符型转换为十进制的整型/////////////////
    IntToBin 10 to 2
    IntToHex 10 to 16
    BinToHex 2 to 16
    HexToBin 16 to 2
      

  6.   


      
    to Liusp(夜深千帐灯) 
    别生气
      

  7.   

    倒~~~~不用自己写吧,delphi本身就提供的,楼上有人写了,但是tohex的就是转16进制的,在delphi5里使用就有点问题了,好象是提示安全性的问题,还是稳定性的,忘记了:p也可能是和fat32有关系,就知道这么多了,仔细看看delphi的帮助吧,很多问题会有答案的:)
      

  8.   

    IntToBin ,BinToHex,HexToBin这几个函数帮助中好像没有。
      

  9.   

    转换是没有必要的. 都是2进制的. 你说的也许是输出的显示效果吧. 看看 formatstring 吧.  如果没有的 自己写一个函数解析一下数据输出成字符串就可以了.