InputBaseN

Converts a string, using the base specified by radix, to an integer.

Method Signature

InputBaseN(string=[string], radix=[integer])

Arguments

Argument
Type
Required
Description
Default

string

string

true

The string to convert to an integer.

radix

integer

true

Base of the number represented by string, in the range 2-36.

Examples

Binary string to decimal

Run Example

inputBaseN( "1010", 2 );

Result: 10

Hexadecimal string to decimal

Run Example

Result: 1023

Decimal string to decimal

Run Example

Result: 125

Binary number to decimal

Run Example

Result: 10

Additional Examples

Run Example

Last updated

Was this helpful?