# multipleOf

> This document is the Markdown version of [valibot.dev/api/multipleOf/](https://valibot.dev/api/multipleOf/). For the complete documentation index, see [llms.txt](https://valibot.dev/llms.txt).

Creates a [multiple](<https://en.wikipedia.org/wiki/Multiple_(mathematics)>) of validation action.

```ts
const Action = v.multipleOf<TInput, TRequirement, TMessage>(
  requirement,
  message
);
```

## Generics

- `TInput` `extends number | bigint`
- `TRequirement` `extends number | bigint`
- `TMessage` `extends ErrorMessage<MultipleOfIssue<TInput, TRequirement>> | undefined`

## Parameters

- `requirement` `TRequirement`
- `message` `TMessage`

### Explanation

With `multipleOf` you can validate the value of a number. If the input does not match the `requirement`, you can use `message` to customize the error message.

## Returns

- `Action` `MultipleOfAction<TInput, TRequirement, TMessage>`

## Examples

The following examples show how `multipleOf` can be used.

### Even number schema

Schema to validate an even number.

```ts
const EvenNumberSchema = v.pipe(
  v.number(),
  v.multipleOf(2, 'The number must be even.')
);
```

## Related

The following APIs can be combined with `multipleOf`.

### Schemas

[`any`](/api/any.md), [`bigint`](/api/bigint.md), [`custom`](/api/custom.md), [`number`](/api/number.md), [`unknown`](/api/unknown.md)

### Methods

[`pipe`](/api/pipe.md)

### Utils

[`isOfKind`](/api/isOfKind.md), [`isOfType`](/api/isOfType.md)
