-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8472f4f
commit 9efcf3e
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
``` |