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

 

INT2HEX

Purpose:

Converts an integer to a hex string.

Syntax:

INT2HEX(ival)

ival

-

An integer.

Returns:

A string, the integer in hex format.

Example:

a = int2hex(15);

b = int2hex(45506)

 

a == "0x000F"

b == "0xB1C2"

 

The integer values are converted to hex strings.

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 HEX2INT to convert a hex string to an integer.

See Also:

HEX2INT

SPRINTF

SETFORMAT