﻿<head><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4357510538660394"
     crossorigin="anonymous"></script></head># 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), 