Skip to content

decimal

Convert a numeric string in any radix to a decimal number.

v = decimal(number, radix)

Inverse of base. Parses the string number as a numeral in base radix (2–36) and returns its decimal value.

decimal('FF', 16) % 255
decimal('1010', 2) % 10
  • base — Convert an integer to a string in a specified radix.
  • bin2dec — Convert a binary string to a decimal number.