Fix Function

Tips >>ASP Functions

WANTS TO MAKE SOFTWARE WITHOUT KNOWLEDGE OF ASP? CLICK HERE


The Fix function returns the integer part of a specified number. The Fix function returns the whole number portion of a numeric arguement. If the arguement is a negative value, it returns the first integer value that is greater than or equal to the arguement. The Fix function converts a decimal number (floating-point) to an integer number (fix-point).

Note :- If the number parameter contains Null, Null will be returned.

The Syntax of the fix function is :-
Fix(number)

Example#1 :-

Code :-
document.write(Fix(6.83227))
Output :-
6

Example#2 :-

Code :-
document.write(Fix(-6.13443))
Output :-
6

Example#3 :-

Code :-
<% =Fix(123.456) %>
Output :-
123

Note :- Positive numbers are not rounded up. The decimal point and all digits to the right are effectively chopped off.

Example#4 :-

Code :-
<% =Fix(-123.899) %>
Output :-
-123

Note :- Negative numbers can also be converted. Negative numbers are rounded up (towards more positive). The decimal point and all digits to the right are effectively chopped off.

Example#5 :-

Before: Code: After:
0.2 Fix(0.2) 0
0.99 Fix(0.99) 0
-1.99 Fix(-1.99) -1

 
E-mail : sales@virtualsplat.com
Phone : +91-9892413501

+91-9967648641

+91-9967648641