See also: binToDec, octToDec |
Converts a hexadecimal number string to an integer.
JSV_hexToDec(expH)
expH.hexToDec()
The hexToDec function returns the decimal number of the hexadecimal number string.
The hexToDec function uses the following arguments.
Argument | Description |
expH | The hexadecimal number string that is to be converted to a decimal. |
There is no checking whether expH is a hexadecimal string. Users of this function should check that the value of expH is a valid argument to this function.
Uses the parseInt
function to return an integer representing the specified binary string.
If the first character cannot be converted to a number, parseInt
returns
NaN
.
n/a
The following lines of code
var f = "10E6";
document.write( "The number " + f + " is decimal " + JSV_hexToDec(f) );
f = "A2C4";
document.write( "The number " + f + " is decimal " + JSV_hexToDec(f) );
produce
Copyright © 1998-2000 Roaring Fork Software. All rights reserved.