> For AI agents: the complete documentation index is available at https://massaman.dev/llms.txt, the full documentation bundle is available at https://massaman.dev/llms-full.txt.

# toNumber

Converts a value to a number.

Thin wrapper over `Number(value)` — kept as a stable surface so callers
don't depend directly on the global constructor's semantics (which have
shifted in the past, e.g. `Number(BigInt)`, and may again).

```typescript
toNumber('42') // 42
toNumber(null) // 0
```

## Usage

### `toNumber(value: unknown)`

Converts a value to a number.

Thin wrapper over `Number(value)` — kept as a stable surface so callers
don't depend directly on the global constructor's semantics (which have
shifted in the past, e.g. `Number(BigInt)`, and may again).

```typescript
import { toNumber } from 'massaman'
// or:  import { toNumber } from 'massaman/conversion'

toNumber('42') // 42
toNumber(null) // 0
```

#### Parameters


valueunknownrequired

the value to convert.

#### Returns

the input value converted using JavaScript number coercion.

```typescript
number
```
