Int64 与 Currency


procedure TForm1.Button1Click(Sender: TObject);
var
  c: Currency;
  i: Int64 absolute c;
begin
  c := 1234.5678;
  ShowMessage(IntToStr(i)); //12345678
end;

procedure TForm1.Button2Click(Sender: TObject);
var
  i: Int64;
  c: Currency absolute i;
begin
  i := 12345678;
  ShowMessage(CurrToStr(c)); //1234.5678
end;

procedure TForm1.Button3Click(Sender: TObject);
var
  i: Int64;
  c: Currency;
begin
  i := 12345;
  ShowMessage(CurrToStr(PCurrency(@i)^)); //1.2345
  c := 3.14;
  ShowMessage(IntToStr(PInt64(@c)^));     //31400
end;

 
 
 
 
 

 

 
  

你可能感兴趣的:(Int64 与 Currency)