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;

posted on 2010-05-03 23:54  万一  阅读(2991)  评论(0编辑  收藏  举报