> 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/isnumber.md).

# isNumber

```typescript
isNumber
```

Verifies if provided `Verificable` represents a value that is a number. Only values that are JS numbers are matching, so string values like `"123"`, or other values coercing to a number will not match this `Predicate`.

The check internally is done by checking the type of the value `typeof value === "number"`.

### Possible errors:

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

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

### Examples:

Each of examples uses this import statement:

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

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

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

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

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

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

```typescript
const verificable = asVerificable(Infinity);
isValid(verificable, isNumber); // true
```

#### Other numbers are considered numbers:

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