DADiSP Worksheet Functions > Function Categories > Data Type Conversion > HEX2INT

 

HEX2INT

Purpose:

Converts a hex string into an integer.

Syntax:

HEX2INT("hextsr")

"hexstr"

-

A string, the hex value.

Returns:

An integer, the integer value of the hex string.

Example:

a = hex2int("0f");

b = hex2int("b1c2")

 

a == 15

b == 45506

 

The hex strings are converted to integer values.

Remarks:

Hex expressions are recognized directly as numeric values when the 0x prefix is attached. For example:

 

0x0f == 15

0xb1c2 == 45506

0x0f + 3 == 18

 

See SETFORMAT to automatically display numerical results in hex format.

 

See INT2HEX to convert an integer to a hex string.

See Also:

INT2HEX

SPRINTF

SETFORMAT