DECIMAL

Converts a text representation of a number in a specified base (radix) into its decimal (base-10) equivalent.

Parameter List

Syntax
DECIMAL(textradix)
text

The text string representing the number in the given base. For example: '1010', '1A', 'Z'.

radix

The base of the number system. An integer between 2 and 36. For example: 2 for binary, 16 for hexadecimal.

More details

DECIMAL interprets a text string as a number in the specified base and converts it to decimal. The text must only use digits valid for the given base (for example, base 2 accepts only 0 and 1, base 16 accepts 0–9 and A–F). The base must be an integer between 2 and 36. If text contains invalid characters for the base, DECIMAL returns an error.

Examples

DECIMAL("FF", 16) returns 255