int()

Description:

This is a data type conversion function. It is used to obtain the integer part of a given numeric value expression or a numeric string, and convert its data type to 32-bit integer.

Syntax:

int(valueExp)

Note:

The returned result of valueExp must be a numeric string or a number.

Parameters:

valueExp

An expression, the result of which must be a numeric string or a number.

Return value:

A 32-bit integer

Example:

int("33")

33

int("33.999d")

33

int(1.5*1.5)

2

int(25.67)

25

Related functions:

float()

decimal()

long()

number()

string()