Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - What function is cint () in VB?
What function is cint () in VB?
CInt is mainly a forced conversion function in VB language.

In general, you can use subtype conversion functions to write code to show that the results of some operations should be expressed as specific data types, rather than default types. For example, in the case of currency, single precision or double precision operations, CInt or CLng is used to perform integer operations.

CInt function is used for internationally recognized format conversion from other data types to integer subtypes. For example, the recognition of decimal separators (such as thousands) may depend on the regional settings of the system.

If the expression is out of the acceptable range of integer subtypes, an error will occur.

Extended data? Note that CInt is different from the Fix and Int functions, which truncate the decimal part of a number instead of rounding it off. When the fractional part is exactly 0.5, the CInt function usually rounds it to the nearest even number. For example, 0.5 is rounded to 0, and 1.5 is rounded to 2.

Type conversion functions Each function can force an expression to be converted to a specific data type.

Using the IsDate function, you can determine whether a date can be converted into a date or time. Cdate can be used to identify date words and time words, as well as values within an acceptable date range. When a number is converted to a date, the integer part is converted to a date, and the decimal part is converted to the time from midnight.

Baidu encyclopedia -CInt