转至繁体中文版     | 网站首页 | 图文教程 | 资源下载 | 站长博客 | 图片素材 | 武汉seo | 武汉网站优化 | 
最新公告:     敏韬网|教学资源学习资料永久免费分享站!  [mintao  2008年9月2日]        
您现在的位置: 学习笔记 >> 图文教程 >> 软件开发 >> Delphi程序 >> 正文
Delphi 函数参考         ★★★★

Delphi 函数参考

作者:闵涛 文章来源:闵涛的学习笔记 点击数:5705 更新时间:2009/4/23 18:27:19
p;  首部 function FloatToStr(Value: Extended): string; $[SysUtils.pas
      功能 返回浮点数Value转换成字符串
      说明 当浮点数大等于1E15将采用科学记数法
      参考 function SysUtils.FloatToText
      例子 Edit1.Text := FloatToStr(Now);
      ━━━━━━━━━━━━━━━━━━━━━
      首部 function CurrToStr(Value: Currency): string; $[SysUtils.pas
      功能 返回货币数Value转换成字符串
      说明 货币数只保留四位小数
      参考 function SysUtils.FloatToText
      例子 Edit1.Text := CurrToStr(Now);
      ━━━━━━━━━━━━━━━━━━━━━
      首部 function FloatToCurr(const Value: Extended): Currency; $[SysUtils.pas
      功能 返回浮点数Value转换成货币数
      说明 如果浮点数Value超出范围则将触发异常
      参考 const SysUtiles.MinCurrency;const SysUtiles.MaxCurrency
      例子 Edit1.Text := CurrToStr(FloatToCurr(Now));
      ━━━━━━━━━━━━━━━━━━━━━
      首部 function FloatToStrF(Value: Extended; Format: TFloatFormat; Precision,
      Digits: Integer): string; $[SysUtils.pas
      功能 返回浮点数以指定格式转换成字符串
      说明 Precision指定精度;Digits指定小数宽度
      参考 function SysUtils.FloatToText
      例子
      ///////Begin FloatToStrF
      procedure TForm1.Button1Click(Sender: TObject);
      begin
      Memo1.Lines.Values[''''ffGeneral''''] := FloatToStrF(StrToFloatDef(Edit1.Text,
      0),
      ffGeneral, SpinEdit1.Value, SpinEdit2.Value);
      Memo1.Lines.Values[''''ffExponent''''] := FloatToStrF(StrToFloatDef(Edit1.Text,
      0),
      ffExponent, SpinEdit1.Value, SpinEdit2.Value);
      Memo1.Lines.Values[''''ffFixed''''] := FloatToStrF(StrToFloatDef(Edit1.Text, 0),
      ffFixed, SpinEdit1.Value, SpinEdit2.Value);
      Memo1.Lines.Values[''''ffNumber''''] := FloatToStrF(StrToFloatDef(Edit1.Text,
0),
      ffNumber, SpinEdit1.Value, SpinEdit2.Value);
      Memo1.Lines.Values[''''ffCurrency''''] := FloatToStrF(StrToFloatDef(Edit1.Text,
      0),
      ffCurrency, SpinEdit1.Value, SpinEdit2.Value);
      end;
      ///////End FloatToStrF
      ━━━━━━━━━━━━━━━━━━━━━
      首部 function CurrToStrF(Value: Currency; Format: TFloatFormat; Digits:
      Integer): string; $[SysUtils.pas
      功能 返回货币类型以指定格式转换成字符串
      说明 Digits指定小数宽度
      参考 function SysUtils.FloatToText
      例子
      ///////Begin CurrToStrF
      procedure TForm1.Button1Click(Sender: TObject);
      begin
      Memo1.Lines.Values[''''ffGeneral''''] := CurrToStrF(StrToCurrDef(Edit1.Text, 0),
      ffGeneral, SpinEdit1.Value);
      Memo1.Lines.Values[''''ffExponent''''] := CurrToStrF(StrToCurrDef(Edit1.Text,
0),
      ffExponent, SpinEdit1.Value);
      Memo1.Lines.Values[''''ffFixed''''] := CurrToStrF(StrToCurrDef(Edit1.Text, 0),
      ffFixed, SpinEdit1.Value);
      Memo1.Lines.Values[''''ffNumber''''] := CurrToStrF(StrToCurrDef(Edit1.Text, 0),
      ffNumber, SpinEdit1.Value);
      Memo1.Lines.Values[''''ffCurrency''''] := CurrToStrF(StrToCurrDef(Edit1.Text,
0),
      ffCurrency, SpinEdit1.Value);
      end;
      ///////End CurrToStrF
      ━━━━━━━━━━━━━━━━━━━━━
      首部 function FloatToText(BufferArg: PChar; const Value; ValueType:
      TFloatValue; Format: TFloatFormat; Precision, Digits: Integer): Integer;
      $[SysUtils.pas
      功能 返回浮点数以指定格式转换成指针字符串的内存大小
      说明 Precision指定精度;Digits指定小数宽度
      参考 <NULL>
      例子
      ///////Begin FloatToText
      procedure TForm1.Button1Click(Sender: TObject);
      var
      vBuffer: array[0..255] of Char;
      E: Extended;
      begin
      E := StrToFloatDef(Edit1.Text, 0);
      SpinEdit3.Value := FloatToText(vBuffer, E,
      fvExtended, ffNumber, SpinEdit1.Value, SpinEdit2.Value);
      Edit2.Text := Copy(vBuffer, 1, SpinEdit3.Value);
      end;
      ///////End FloatToText(
      ━━━━━━━━━━━━━━━━━━━━━
      首部 function FormatFloat(const Format: string; Value: Extended): string;
      $[SysUtils.pas
      功能 返回浮点数类型以指定格式字符串Format转换成字符串
      说明 FormatFloat('''',.00'''', 1234567890) = ''''1,234,567,890.00''''
      参考 function SysUtils.FloatToTextFmt
      例子 Edit1.Text := FormatFloat(Edit2.Text, StrToFloatDef(Edit3.Text, 0));
      ━━━━━━━━━━━━━━━━━━━━━
      首部 function FormatCurr(const Format: string; Value: Currency): string;
      $[SysUtils.pas
      功能 返回货币类型以指定格式字符串Format转换成字符串
      说明 FormatCurr('''',.00'''', 1234567890) = ''''1,234,567,890.00''''
      参考 function SysUtils.FloatToTextFmt
      例子 Edit1.Text := FormatCurr(Edit2.Text, StrToCurrDef(Edit3.Text, 0));
      ━━━━━━━━━━━━━━━━━━━━━
      首部 function FloatToTextFmt(Buf: PChar; const Value; ValueType:
      TFloatValue; Format: PChar): Integer; $[SysUtils.pas
      功能 返回浮点数以指定格式字符串Format转换成指针字符串的内存大小
      说明 ValueType指定无类型参数Value的类型
      参考 <NULL>
      例子
      ///////Begin FloatToTextFmt
      procedure TForm1.Button1Click(Sender: TObject);
      var
      vBuffer: array[0..255] of Char;
      E: Extended;
      begin
      E := StrToFloatDef(Edit1.Text, 0);
      SpinEdit1.Value := FloatToTextFmt(vBuffer, E,
      fvExtended, PChar(Edit2.Text));
      Edit3.Text := Copy(vBuffer, 1, SpinEdit1.Value);
      end;
      ///////End FloatToTextFmt
      ━━━━━━━━━━━━━━━━━━━━━
      首部 function StrToFloat(const S: string): Extended; $[SysUtils.pas
      功能 返回字符串S转换成浮点数
      说明 字符串非浮点数表达时将引起异常
      参考 function SysUtils.TextToFloat
      例子 var E: Extended; begin E := StrToFloat(Edit1.Text); end;
      ━━━━━━━━━━━━━━━━━━━━━
      首部 function StrToFloatDef(const S: string; const Default: Extended):
      Extended; $[SysUtils.pas
      功能 返回字符串S转换成浮点数
      说明 字符串非浮点数表达时则返回默认值Default
      参考 function SysUtils.TextToFloat
      例子 var E: Extended; begin E := StrToFloatDef(Edit1.Text, 0); end;
      ━━━━━━━━━━━━━━━━━━━━━
      首部 function TryStrToFloat(const S: string; out Value: Extended): Boolean;
      overload; $[SysUtils.pas
      首部 function TryStrToFloat(const S: string; out Value: Single): Boolean;
      overload; $[SysUtils.pas
      首部 function TryStrToFloat(const S: string; out Value: Double): Boolean;
      overload; $[SysUtils.pas
      功能 返回字符串S转换成浮点数Value是否成功
      说明 字符串非浮点数表达时返回False并且Value将输出为不确定的值
      参考 function SysUtils.TextToFloat
      例子
      ///////Begin TryStrToFloat
      procedure TForm1.Button1Click(S

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]  ...  下一页 >> 


[系统软件]InstallShield Express for delphi制作安装程序定…  [常用软件]InstallShield Express制作Delphi数据库安装程序
[Delphi程序]为什么选择Delphi.Net ?  [Delphi程序]《关于VisiBroker For Delphi的使用》(4)
[Delphi程序]Delphi 程序员代码编写标准指南  [Delphi程序]转贴:Conversion to Delphi 6: Missing unit Pro…
[Delphi程序]Borland Delphi 9 的新特性  [Delphi程序]Delphi 键盘码表
[Delphi程序]Chuck Jazdzewski的离开意味着Delphi的终结吗?  [Delphi程序]Delphi Access violations 问题的解决之道
教程录入:mintao    责任编辑:mintao 
  • 上一篇教程:

  • 下一篇教程:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
      注:本站部分文章源于互联网,版权归原作者所有!如有侵权,请原作者与本站联系,本站将立即删除! 本站文章除特别注明外均可转载,但需注明出处! [MinTao学以致用网]
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)

    同类栏目
    · C语言系列  · VB.NET程序
    · JAVA开发  · Delphi程序
    · 脚本语言
    更多内容
    热门推荐 更多内容
  • 没有教程
  • 赞助链接
    更多内容
    闵涛博文 更多关于武汉SEO的内容
    500 - 内部服务器错误。

    500 - 内部服务器错误。

    您查找的资源存在问题,因而无法显示。

    | 设为首页 |加入收藏 | 联系站长 | 友情链接 | 版权申明 | 广告服务
    MinTao学以致用网

    Copyright @ 2007-2012 敏韬网(敏而好学,文韬武略--MinTao.Net)(学习笔记) Inc All Rights Reserved.
    闵涛 投放广告、内容合作请Q我! E_mail:admin@mintao.net(欢迎提供学习资源)

    站长:MinTao ICP备案号:鄂ICP备11006601号-18

    闵涛站盟:医药大全-武穴网A打造BCD……
    咸宁网络警察报警平台