FROM_BASE

All functions > MATH > FROM_BASE

Returns the decimal (base 10) equivalent of a number from a specified base.

Signatures

Returns: The decimal (base 10) equivalent

FROM_BASE(number_string: VARCHAR, base: BIGINT) → BIGINT
sql
ParameterTypeRequiredDescription
number_stringVARCHARYesString representation of the number in the source base
baseBIGINTYesThe base to convert from (2-36)

Notes

  • Supports bases from 2 (binary) to 36
  • For bases > 10, uses letters A-Z for digits 10-35
  • Case-insensitive for letter digits
  • Returns NULL if number_string is NULL or invalid
  • Useful for converting binary, octal, hexadecimal numbers

Examples

FeatureQL
SELECT
    f1 := FROM_BASE('1010', 2),  -- Binary to decimal
    f2 := FROM_BASE('777', 8),  -- Octal to decimal
    f3 := FROM_BASE('FF', 16),  -- Hexadecimal to decimal
    f4 := FROM_BASE('CAFE', 16)  -- Hex word to decimal
;
Result
f1 BIGINTf2 BIGINTf3 BIGINTf4 BIGINT
1051125551966

Last update at: 2026/03/03 16:47:38
Last updated: 2026-03-03 16:48:19