> 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.

# toFinite

Converts a value to a finite number.

Returns `0` for non-finite results (`NaN`, `Infinity`, `-Infinity`).

```typescript
toFinite('3.14') // 3.14
toFinite(Infinity) // 0
```

## Usage

### `toFinite(value: unknown)`

Converts a value to a finite number.

Returns `0` for non-finite results (`NaN`, `Infinity`, `-Infinity`).

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

toFinite('3.14') // 3.14
toFinite(Infinity) // 0
```

#### Parameters


valueunknownrequired

the value to convert.

#### Returns

the converted finite number, or `0` when conversion produces a non-finite value.

```typescript
number
```
