DTX()

DTX()

Top  Previous  Next

 

The DTX() function converts a number to hexadecimal.

 

 

Format

 

DTX(expr {, min.width})

 

where

 

exprevaluates to the number to be converted.

 

min.widthspecifies the minimum number of digits in the converted result.

 

 

The DTX() function converts the supplied expr value to hexadecimal. If the converted value is shorter than min.width, leading zeros are added.

 

 

Examples

 

In each example, the DISPLAY statement is followed by the output that it would produce. Note that DTX() treats the value as an unsigned 32 bit quantity and hence negative numbers will always appear as 8 hexadecimal digits.

 

DISPLAY DTX(87)

57

 

DISPLAY DTX(87,4)

0057

 

DISPLAY DTX(-21,4)

FFFFFFEB

 

 

See also:

XTD()