举例:
var
  s: string;
begin
  Str(123, s);
  ShowMessage(s);  {123}

  Str(PI, s);
  ShowMessage(s);  {3.14159265358979E+0000}

  Str(PI:0:2, s);
  ShowMessage(s);  {3.14}

  Str(9.1:1:3, s);
  ShowMessage(s);  {9.100}

  Str(100:5, s);
  ShowMessage('^' + s);  {^  100}
end;

System 单元下的公用函数目录

posted on 2008-03-29 22:43  万一  阅读(2955)  评论(0编辑  收藏  举报