Several integer functions in ASP are: Fix (), INT (), round ();
The int (number) and fix (number) functions return the integer part of the number. The number parameter can be any valid numeric expression. If the Number Parameter contains null, null is returned.
Example:
Response. Write int (2.14) '2
Response. Write fix (2.14) '2
Response. Write int (2.54) '2
Response. Write int (2.54) '2
Both the int and fix functions Delete the fractional part of the Number Parameter and return the result expressed as an integer. The difference between the int and fix functions is that if the number parameter is negative, the int function returns the first negative integer less than or equal to the number, and the fix function returns the first negative integer greater than or equal to the number parameter. For example, int converts-8.4 to-9, and the fix function converts-8.4 to-8.
Round (expression [, numdecimalplaces]) returns the value rounded by the specified number of digits. Expression is required. The numeric expression is rounded down. Numdecimalplaces is optional. Number indicates the number of digits to the right of the decimal point. If this parameter is omitted, the round function returns an integer.
Example:
Response. Write round (3.14) '3
Response. Write round (3.55) '4
Response. Write round (3.1415, 3) '123'