Data / Math
data/clamp
Clamp
Clamps a number between a minimum and maximum value.
Note: Useful for keeping health, food level, or balances within valid ranges.
Inputs
| Name | Type | Optional | Description |
|---|---|---|---|
value |
number | The value to clamp. | |
min |
number | ✓ | Minimum bound. |
max |
number | ✓ | Maximum bound. |
Outputs
| Name | Type | Description |
|---|---|---|
result |
number | The clamped value. |
Properties
| Key | Type | Default | Description |
|---|---|---|---|
min |
number | 0 |
Min |
max |
number | 100 |
Max |