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
- multipleOf (optional) 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 (optional) The minimum acceptable number
x >= minimum
. Default is the maximum double value. - minimumExclusive (optional) The number has to be greater than this
x > minimumExclusive
. Default is false - maximum (optional) The maximum acceptable number
x <= minimum
. Default is the maximum double value. - maximumExclusive (optional) The number has to be greater than this
x < minimumExclusive
. Default is false - showSlider (opotional) Shows a slider widget bounded by minimum and maximum along side the text entry field. Default is false
- sliderTickIncrement (optional) The interval between the ticks on the slider . If unspecified or set to 0, the tick increment will be automatically calculated. Default is 0
Example
{
"name": "somenumber",
"type": "number",
"valueType": "float",
"prompt": "Minimum Separation",
"multipleOf": 0.0001,
"minimum": 0
}