网站公告列表

  没有公告

加入收藏
设为首页
联系站长
您现在的位置: 网络学院 >> 程序设计 >> Delphi编程 >> 文章正文
  Format格式化函数使用            【字体:
Format格式化函数使用
作者:佚名    文章来源:不详    点击数:    更新时间:2007-9-12    
正在装载数据……

 

Format
Format(const Format: string;const Args: array of string ): string; 
-----------------------------------------------------------------------------
Unit        SysUtils
函数原型    procedure FmtStr(var Result
: string; const Format: string;
                const Args
: array of const);
            function 
Format(const Format: string; const Args: array of
                const)
: string;
说明        
%d :    整数
            
%e :    科学式
            
%f :    定点实数
            
%g :    实数
            
%n :    实数(-d,ddd,ddd.dd ...)
            
%m:    金钱格式
            
%p :    point
            
%s :    字串
            
%x :    Hex
范例        var
              i
: Integer;
              j
: Double;
              s
: String;
              t
: String;
            begin
              t
:=Format('%d %8.2f %s',[i,j,s]);
              ListBox1
.Item.Add(t);
            end;

BubbleSeries1
.PercentFormat := '##0.0# %';
Example
procedure TForm1
.Table1AfterDelete(DataSet: TDataSet);
begin
  StatusBar1
.SimpleText := Format('There are now %d records in the table', [DataSet.RecordCount]);
end;

S
:= Format'1-? ??????? ??????? - %d, 2-? - %d, 3-? - %d', [10,20,30] );




Format'%*.*f', [ 9, 2, 12345.6789 ] );
Format'%9.2f', [ 12345.6789 ] );
Format'%3d, %d, %0:d, %2:-4d, %d', [ 1, 2, 3, 4 ] );
'   1,2,1,3   ,4'


##  AfterDelete, Format Example

 




本文来源:http://blog.csdn.net/cnhnjxxz/archive/2007/08/22/1754742.aspx
站内文章搜索 高级搜索
文章录入:admin    责任编辑:admin 
  • 上一篇文章:

  • 下一篇文章:
  • 发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    最新热点 最新推荐 相关文章
     在delphi中使用xml文档有…
     初探delphi 7 中的插件编…
     delphi 2006(dexter) & …
     获得windows的版本信息。
     “序列号输入助手”源代…
     rs232串口通讯模块
     ado方式下判断数据表是否…
  • page、request、session、ap…

  • HashTable和HashMap; Vecto…

  • Core Java 之旅

  • iBatis一级缓存的探讨

  • weblogic 9.1的domain配置my…

  • SPRING+STRUTS+HIBERNATE登录…

  • 一个关于Comparator的使用例…

  • jsp重定向forward和sendRedi…

  • tomcat下配置jspservletbean…

  • sizeof 操作符及pragma内存对…

  •   网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    网络学院©2007 www.23book.net
    为您提供web编程,vb编程,vc编程,服务器架设管理,数据库设计等方面的知识 站长:David