# 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](https://try.boxlang.io/?code=eJzLzCsoLXFKLE7101BQMjQwNFDSUTBS0LTmAgBlkwZU)

```java
inputBaseN( "1010", 2 );

```

Result: 10

### Hexadecimal string to decimal

[Run Example](https://try.boxlang.io/?code=eJzLzCsoLXFKLE7101BQMnZzU9JRMDRT0LTmAgBnZwaG)

```java
inputBaseN( "3FF", 16 );

```

Result: 1023

### Decimal string to decimal

[Run Example](https://try.boxlang.io/?code=eJzLzCsoLXFKLE7101BQMjQyVdJRMDRQ0LTmAgBlqwZZ)

```java
inputBaseN( "125", 10 );

```

Result: 125

### Binary number to decimal

[Run Example](https://try.boxlang.io/?code=eJzLzCsoLXFKLE7101AwNDA00FEwUtC05gIAWYMGEA%3D%3D)

```java
inputBaseN( 1010, 2 );

```

Result: 10

### Additional Examples

[Run Example](https://try.boxlang.io/?code=eJwrL8osSXUpzS3QUPDMKygtcUosTvXTUFAyNDAAIiUdBSMFTQVNawV9fQVjMwWnzLzEokqFknyFlNTkzNzEHIW0%2FKLcxBKuchzGmJqYAs2wQJhhaq7gAtUKNMU%2FuYSwGY5AEwzNwEZwgcwwNFDwSK1ITEEYA2VyAQCMXTzo)

```java
writeDump( InputBaseN( "100100", 2 ) ); // 36 Binary to decimal format
writeDump( InputBaseN( "545", 8 ) ); // 357 Decimal to Octal format
writeDump( InputBaseN( "A", 16 ) );
 // 10 Hexadecimal to decimal

```

## Related

* [Abs](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/math/abs)
* [Acos](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/math/acos)
* [Asin](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/math/asin)
* [Atn](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/math/atn)
* [Ceiling](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/math/ceiling)
* [Cos](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/math/cos)
* [DecrementValue](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/math/decrementvalue)
* [Exp](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/math/exp)
* [Fix](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/math/fix)
* [Floor](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/math/floor)
* [FormatBaseN](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/math/formatbasen)
* [IncrementValue](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/math/incrementvalue)
* [Int](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/math/int)
* [Log](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/math/log)
* [Log10](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/math/log10)
* [Max](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/math/max)
* [Min](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/math/min)
* [Pi](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/math/pi)
* [PrecisionEvaluate](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/math/precisionevaluate)
* [Rand](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/math/rand)
* [Randomize](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/math/randomize)
* [RandRange](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/math/randrange)
* [Round](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/math/round)
* [Sgn](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/math/sgn)
* [Sin](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/math/sin)
* [Sqr](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/math/sqr)
* [Tan](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/math/tan)
