# isInteger

```typescript
isInteger
```

Verifies if provided `Verificable` represents a number that is an integer. Integer values are values with the part after decimal point being `0`.

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

### Possible errors:

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

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

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

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

### Examples:

Each of examples uses this import statement:

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

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

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

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

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

#### `Infinity`, `-Infinity`, or `NaN` are not considered integers:

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

#### Numbers with non-zero decimal part are not considered integers:

```typescript
const verificable = asVerificable(12345.67);
isValid(verificable, isInteger); // false
```

#### Numbers with decimal part equal to zero are considered integers:

```typescript
const verificable = asVerificable(12345);
isValid(verificable, isInteger); // true
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://radoslaw-medryk.gitbook.io/verifica/predicates/built-in-predicates/isinteger.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
