# Number validations

* `required`: can't be undefined (default: `false`)
* `equal`: **\*** equal to passed value
* `integer`: must be an integer (default: `false`)
* `precision`: maximum number of decimal places
* `positive`: must be positive (default: `false`)
* `negative`: must be negative (default: `false`)
* `multiple`: must be a multiple of the passed value
* `min`: **\*\*** minimum valid value (works like the `>=` operator)
* `greater`: **\*\*** must be greater than passed value (works like the `>` operator)
* `max`: **\*\*** maximum valid value (works like the `<=` operator)
* `less`: **\*\*** must be smaller than passed value (works like the `<` operator)
* `nullable`: accepts null (default: `false`)

```javascript
const Pool = attributes({
  depth: {
    type: Number,
    positive: true
  },
  width: {
    type: Number,
    min: { attr: 'depth' }
  },
  length: {
    type: Number,
    greater: { attr: 'width' }
  },
  capacity: {
    type: Number,
    nullable: true
  }
})(class Pool {
  getVolume() {
    return this.depth * this.width * this.length;
  }
});
```


---

# 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://structure.js.org/validation/number-validations.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.
