Borland C++ Builder VCL的數值轉換函式

來源:互聯網
上載者:User
 五.Borland C++ Builder VCL的數值轉換函式

  1. IntToStr
  將整數轉換為AnsiString字串,函數原型如下:
  AnsiString __fastcall IntToStr(int Value);

  2. IntToHex
  將整數轉換為十六進位字串,函數原型如下:
  AnsiString __fastcall IntToHex(int Value, int Digits);

  3. StrToInt
  將AnsiString字串轉換為整數值,如果不能進行轉換,則產生EConvertError異常,
  函數原型如下:
  int __fastcall StrToInt(const AnsiString S);

  4. StrToIntDef
  將AnsiString字串轉換為一個數值,函數原型如下:
  int __fastcall StrToIntDef(const System::AnsiString S,int Default);

  5. FloatToStr
  將浮點數轉換為AnsiString字串,函數原型如下:
  AnsiString __fastcall FloatToStr(Extended Value);

  6. StrToFloat
  將AnsiString字串轉換為一個浮點數值,函數原型如下:
  Extended __fastcall StrToFloat(const AnsiString S);

  7. FloatToStrF
  將浮點數轉換為指定格式的AnsiString字串,函數原型如下:
  AnsiString __fastcall FloatToStrF(Extended Value, TFloatFormat Format,int Precision, int Digits);

  六.Borland C++ Builder VCL的時間函數

  1. Date
  返回TDateTime對象,包含當前的年月日資訊,函數原型如下:
  System::TDateTime __fastcall Date(void);

  2. Time
  返回TDateTime對象,包含當前的時間資訊,函數原型如下:
  System::TDateTime __fastcall Time(void);

  3. Now
  返回TDateTime對象,擷取當前的日期和時間資訊,函數原型如下:
  System::TDateTime __fastcall Now(void);

  4. DatetimeToString
  將TDateTime對象轉換為指定格式的字串對象,函數原型如下:
  void __fastcall DateTimeToString(AnsiString &;Result, const AnsiString Format,System::TDateTime DateTime);

  5. DateToStr
  將TDateTime對象(包含當前年月日資訊)轉換為字串對象,函數原型如下:
  AnsiString __fastcall DateToStr(System::TDateTime Date);

  6. TimeToStr
  將當前日期轉換為字串對象,函數原型如下:
  AnsiString __fastcall TimeToStr(System::TDateTime Time);

  7. DateTimetoStr
  將TDateTime對象轉換為字串對象,函數原型如下:
  AnsiString __fastcall DateTimeToStr(System::TDateTime DateTime);

  8. StrToDate
  將字串對象轉換為年月日對象,函數原型如下:
  System::TDateTime __fastcall StrToDate(const AnsiString S);

  9. StrToTime
  將字串對象轉換時間對象,函數原型如下:
  System::TDateTime __fastcall StrToTime(const AnsiString S);

  10.StrToDateTime
  將字串對象轉換為年月日時間對象,函數原型如下:
  System::TDateTime __fastcall StrToDateTime(const AnsiString S);

  11.DateTimeToSystemTime
  將TDateTime對象轉換為作業系統時間,函數原型如下:
  void __fastcall DateTimeToSystemTime(System::TDateTime DateTime, _SYSTEMTIME &;SystemTime);

  12.SystemTimeToDateTime
  將作業系統時間轉換為TDateTime對象,函數原型如下:
  System::TDateTime __fastcall SystemTimeToDateTime(const _SYSTEMTIME &;SystemTime);

本文引用地址: http://blog.csdn.net/extcsdn/services/trackbacks/449494.aspx

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.