问个简单的转换问题
A=5442465  我想把A转成16进制后前面还要加上'$'

解决方案 »

  1.   

    procedure TForm1.Button1Click(Sender: TObject);var
      i: Integer;
    begin
      Label1.Caption := '';
      for i := 1 to Length(Edit1.Text) do
      begin
        try
          Label1.Caption := Label1.Caption + IntToHex(Edit1.Text[i],2) + ' ';
        except
          Beep;
        end;
      end;
      label1.caption:='$'+label1.caption;
    end;
      

  2.   

      A := 5442465;
      s := Format('$%x', [A]);
      

  3.   

    confucius 
    我想再问你个问题 你的方式我试了下可以
    但是Format( '$%x ', [A]);    中间的'$%x'我换趁'$'好象结果一样 请问为什么要用'$%x'
      

  4.   

    confucius 
    我想再问你个问题 你的方式我试了下可以
    但是Format( '$%x ', [A]);    中间的'$%x'我换趁'$'好象结果一样 请问为什么要用'$%x'