Hex Function

Tips >>ASP Functions

WANTS TO MAKE SOFTWARE WITHOUT KNOWLEDGE OF ASP? CLICK HERE

The Hex function returns a string that represents the hexadecimal value of a specified number. Returns a string representing the hexadecimal value of a number.

Note :- If number is not a whole number, it is rounded to the nearest whole number before being evaluated.

The following are the Hex returns explained :-

If number is Hex returns
Null Null.
Empty Zero (0).
Any other number Up to eight hexadecimal characters.


You can represent hexadecimal numbers directly by preceding numbers in the proper range with &H. For example, &H10 represents decimal 16 in hexadecimal notation.


The Syntax of the Hex function is :-

Hex(number)

Example#1 :-

Code :-
document.write(Hex(3) & "<br />")
document.write(Hex(5) & "<br />")
document.write(Hex(9) & "<br />")
document.write(Hex(10) & "<br />")
document.write(Hex(11) & "<br />")
document.write(Hex(12) & "<br />")
document.write(Hex(400) & "<br />")
document.write(Hex(459) & "<br />")
document.write(Hex(460))
Output :-
3
5
9
A
B
C
190
1CB
1CC

Example#2 :-

Before: Code: After:
10 Hex(10) A
255 Hex(255) FF
17 Hex(17) 11

Example#3 :-

Code :-
<% =Hex(123) %>
Output :-
7B

Note :- You can also use a negative integer number.

Example#4 :-

Code :-
<% =Hex(-123) %>
Output :-
FF85

Note :- For a number with a decimal point (floating-point), the digits to the right of the decimal point are ignored.

Example#5 :-

Code :-
<% =Hex(123.456) %>
Output :-
7B

 

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

Whatsapp Icon +91-9967648641

Whatsapp Icon +91-9967648641