HEXTODEC

This command converts a non-negative hexadecimal integer to its decimal (base 10) equivalent.

Syntax

HEXTODEC "string"

"String" can be any hexadecimal integer from "0" through
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
equivalent to decimal integers 0 through 1.12355820928895E+307.

It is not case sensitive; symbols "A" - "F" are the same as "a" - "f".

Do not specify any prefix such as "0x".

Return value

This command returns a number.

Notes

This command returns the decimal value of the specified hexadecimal string, formatted as a number.

The "string" will be interpreted as a non-negative value. (Unlike the DECTOHEX command, HEXTODEC does not interpret a hexadecimal string greater than "7FFFFFFF" as a negative integer represented as a two's-complement signed 32-bit value.)

If the "string" you specify is invalid, this command returns the number 0.

See also: DECTOHEX

Examples

HEXTODEC "5F"

This formula returns the number 95.

HEXTODEC "FFFFFFA1"

This formula returns the number 4294967201.

HEXTODEC "ffffffa1"

This formula returns the number 4294967201.

HEXTODEC "80000000"

This formula returns the number 2147483648.

HEXTODEC "0x80000000"

The prefix "0x" renders this string invalid, so this formula returns the number 0.