> For the complete documentation index, see [llms.txt](https://radoslaw-medryk.gitbook.io/verifica/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://radoslaw-medryk.gitbook.io/verifica/predicates/built-in-predicates/isfinitenumber.md).

# isFiniteNumber

```typescript
isFiniteNumber
```

Verifies if provided `Verificable` represents a number that is a finite value. Number values like `Infinity`, `-Infinity`, `NaN`, since not a finite values, will not match this `Predicate`.

The check internally is done by calling the JS function `Number.isFinite()`.

### Possible errors:

#### If provided `Verificable` is not a number:

```typescript
{
    type: "isNumber",
    path: [/* ... */]
}
```

#### If provided `Verificable` is not a finite number:

```typescript
{
    type: "isFiniteNumber",
    path: [/* ... */]
}
```

### Examples:

Each of examples uses this import statement:

```typescript
const { asVerificable, isValid, isFiniteNumber } = require("verifica");
```

#### Null or undefined is not considered a number:

```typescript
const verificable = asVerificable(null);
isValid(verificable, isFiniteNumber); // false
```

#### String value is not considered a number as well:

```typescript
const verificable = asVerificable("123");
isValid(verificable, isFiniteNumber); // false
```

#### `Infinity`, `-Infinity`, or `NaN` are not considered finite numbers:

```typescript
const verificable = asVerificable(Infinity);
isValid(verificable, isFiniteNumber); // false
```

#### Other numbers are considered finite numbers:

```typescript
const verificable = asVerificable(12345.67);
isValid(verificable, isFiniteNumber); // true
```
