Purpose: Converts a value to an integer. The value parameter can be of any type except the object type. If the value is of type string and the base parameter is given, then base is taken as the base (e.g. 10 for decimal, 16 for hex numbers) for the value. If base is not given, it defaults to 10. If value is of type string and the position parameter is given, then position must denote a value to which an integer value can be assigned that is the last position in the value string that has been scanned successfully for an integer. If the string value cannot be converted, 0 is assigned to the position.
Return Values: Returns null if value is null or if value cannot be converted to an integer value. Returns value if value is an integer. If value is of type real, all digits after the comma are removed. If value is of type Boolean, 0 is returned for a false value and 1 is returned for a true value.
See Also: real().
© 1996-2019 H.E.I. All Rights Reserved.