Number
A widget that allows users to enter integers or floats and supports basic numeric validation.
The range of acceptable values can be limited using minimum
or minimumExclusive
and maximum
or maximumExclusive
.
The number can also be limited to a certain step size by using multipleOf
. For example, to allow digits up
to two decimal places, set multipleOf
to 0.01
.
Specification
key | type | required | default value | description |
---|---|---|---|---|
multipleOf | float | no | n/a | Restricts the number to be a multiple of this value (eg. "multipleOf": 0.1 would allow any number up to one decimal place). Default is to allow as much precision as possible. |
minimum | float | no | minimum double value | The minimum acceptable number, where x >= minimum unless minimumExclusive is true, in which case x > minimum . |
minimumExclusive | boolean | no | false |
If true, the number has to be strictly greater than the minimum (x > minimum ). |
maximum | float | no | maximum double value | The maximum acceptable number, where x <= maximum unless maximumExclusive is true, in which case x < maximum . |
maximumExclusive | boolean | no | false |
If true, the number has to be strictly less than the maximum (x < maximum ). |
showSlider | boolean | no | false |
Shows a slider widget bounded by minimum and maximum along side the text entry field. |
sliderTickIncrement | float | no | 0 | The interval between the ticks on the slider . If unspecified or set to 0, the tick increment will be automatically calculated. |
Example
{
"name": "somenumber",
"type": "number",
"valueType": "string",
"prompt": "Minimum Separation",
"multipleOf": 0.0001,
"minimum": 0,
"minimumExclusive": false
}