Skip to content

Commit e27ecd1

Browse files
authored
Merge pull request #384 from MarcMeszaros/guide-number-widget-precision
Update documentation to mention 'precision' as widget option
2 parents 976ba6f + b80209f commit e27ecd1

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

guides/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ function MyNodeType()
187187
```
188188

189189
This is the list of supported widgets:
190-
* **"number"** to change a value of a number, the syntax is ```this.addWidget("number","Number", current_value, callback, { min: 0, max: 100, step: 1} );```
190+
* **"number"** to change a value of a number, the syntax is ```this.addWidget("number","Number", current_value, callback, { min: 0, max: 100, step: 1, precision: 3 } );```
191191
* **"slider"** to change a number by dragging the mouse, the syntax is the same as number.
192192
* **"combo"** to select between multiple choices, the syntax is:
193193

@@ -205,6 +205,7 @@ The fourth optional parameter could be options for the widget, the parameters ac
205205
* **property**: specifies the name of a property to modify when the widget changes
206206
* **min**: min value
207207
* **max**: max value
208+
* **precision**: set the number of digits after decimal point
208209
* **callback**: function to call when the value changes.
209210

210211
Widget's value is not serialized by default when storing the node state, but if you want to store the value of widgets just set serialize_widgets to true:

0 commit comments

Comments
 (0)