Definitions and descriptions of Delphi conversion functions
Source: Internet
Author: User
◇ [DELPHI] definition and description of conversion functions
Datetimetofiledate (datetime: Tdatetime): longint; convert the datetime value in Tdatetime format to the datetime value in DOS format
Datetimetostr (datetime: Tdatetime): string; convert the Tdatatime format variable to a string. If the datetime parameter does not contain the date value, return the string date displayed as 00/00/00, if the datetime parameter does not contain a time value, the time part of the returned string is displayed as 00:00:00 AM.
Datetimetostring (var result string;
Const format: string;
Datetime: Tdatetime); according to the given format String Conversion time and date value, result is the result string, format is the conversion format String, datetime is the date Time Value
Datetostr (date: Tdatetime) converts the date parameter to the corresponding string using the format string defined by the shortdateformat global variable
Floattodecimal (var result: Tfloatrec; value:
Extended; precision, decimals:
Integer); converts a floating point to a decimal representation.
Floattostr (value: extended): string converts a floating point value to a string format. This conversion uses the common numeric format, and the valid digits of the conversion are 15 digits.
Floattotext (buffer: pchar; value: extended;
Format: Tfloatformat; precision,
Digits: integer): integer. The floating point value is converted into a decimal representation using the given format, precision, and decimal number. The conversion result is stored in the buffer parameter, the Return Value of the function is the number of characters stored in the buffer, and the buffer is a string buffer with non-zero results.
Floattotextfmt (buffer: pchar; value: extended;
Format: pchar): integer converts a floating point value to a decimal representation in the given format. The conversion result is stored in the buffer parameter, and the return value of the function is the number of characters stored in the buffer.
Inttohex (value: longint; digits: integer ):
String; converts a given value to a hexadecimal string. The digits parameter indicates the number of digits contained in the conversion result string.
Inttostr (value: longint): string converts an integer to a decimal string.
Strtodate (const S: string): Tdatetime converts a string to a date value. S must contain a string in a valid date format.
Strtodatetime (const S: string): Tdatetime converts string S to the datetime format. S must be in MM/DD/yy hh: MM: SS [AM | PM] format, the date and time delimiters are related to the time constant settings in the system period. If the AM or PM information is not specified, the 24-hour format is used.
Strtofloat (const S: string): extended; converts a given string to a floating point. The string has the following format:
[+ |-] Nnn... [.] Nnn... [<+ |-> <E | e> <+ |-> nnnn]
Strtoint (const S: string): longint converts a numeric string to an integer. The string can be in decimal or hexadecimal format. If the string is not a legal numeric string, an ECONVERTERROR exception occurs.
Strtointdef (const S: string; default:
Longint): longint; converts string s to a number. If the string s cannot be converted to a number, the strtointdef function returns the default value.
Strtotime (const S: string): tdatetime converts string s to a tdatetime value. S has the format of HH: mm: ss [am | PM, the actual format is related to the global variables related to the system time.
Timetostr (Time: tdatetime): string; converts the time parameter to a string. The format of the Conversion Result string is related to the system time-related constant settings.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service