Converts a number in a given base to its corresponding decimal value.
Syntax:
DECIMAL(number, radix:Number)
number is a text string of digits in the given radix. Alternatively, a number may be supplied which is similarly treated as a string of digits - these must be in the given radix.
radix must be greater than or equal to two and less than or equal to thirty six.
If radix is greater than ten, letters in the range A to Z (or a to z) are used to represent ten upwards.
If radix is two (binary), an optional suffix B (or b) may be supplied.
If radix is sixteen (hexadecimal), an optional prefix 0x or an optional suffix H (or h) may be supplied.
Examples:
DECIMAL("00001000", 16)
returns the number 4096
.
DECIMAL("1010B", 2)
returns the number 10
.
DECIMAL(377, 8)
returns the number 255
.
Revisions:
This function was added in 2.24.