Skip to content

Commit

Permalink
docs: added number type docs
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvinJWendt committed Feb 9, 2024
1 parent 8472f4f commit 9efcf3e
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions docs/syntax/types/number.md
Original file line number Diff line number Diff line change
@@ -1 +1,46 @@
# Number

The `number` type can be used to define variables that accept numeric input.

## Basic

Basic syntax for the `number` type:

```yaml
variables:
- name: Age
type: number # Set the type to number
description: Age of the person
template: |-
You are {{ .Age }} years old.
```
## Validation
### Minimum
You can use the `min` property to define a minimum value for validation:

```yaml
variables:
- name: Age
type: number
min: 18 # only allow ages 18 and above
description: Age of the person
template: |-
You are {{ .Age }} years old.
```

### Maximum

You can use the `max` property to define a maximum value for validation:

```yaml
variables:
- name: Age
type: number
max: 99 # only allow ages 99 and below
description: Age of the person
template: |-
You are {{ .Age }} years old.
```

0 comments on commit 9efcf3e

Please sign in to comment.