Widgets/Producer
Random Between Widget
Random Between Widget
A "Producer" type widget. Random Between Widget generates random numerical values between specified minimum and maximum limits. It intelligently handles both integer and decimal (floating point) values.
Inputs
- In (DataType: Anything) When any event arrives at this input, the Widget will generate and output a random value.
Outputs
- Output (DataType: Number) Outputs a random number between the minimum and maximum values.
Custom Settings
-
Min Value The minimum value in the random range (inclusive). This means the generated number can be equal to this value.
-
Max Value The maximum value in the random range (exclusive). This means the generated number will always be less than this value.

📌 Important Notes
- If both Min and Max are integers, the output will be an integer
- If either Min or Max contains decimal places, the output will be a decimal value with precision matching the input with the highest precision
Examples
This example uses a Clock widget to trigger the Random Between widget every second, generating random decimal values that are displayed on screen.
Drag the example onto the workspace to explore and experiment!
In this example
- The Clock widget generates events every 500ms (twice per second)
- Each clock event triggers the Random Between widget
- The Random Between widget generates a number between 0.1 and 2
- The Display widget shows the generated random value
- Two Button widgets control this process:
- Start Button widget begins the sequence
- Stop Button widget ends it
📌 Additional Notes
- The Widget uses JavaScript's
Math.random()function internally to generate the random values. The output is then scaled and adjusted to match your specified range.
Glossary
-
Floating Point
A number that can have a decimal point and fractional part.
-
Integer
A whole number without any decimal or fractional part.
-
Math.random()
A JavaScript function that returns a random floating-point number between 0 (inclusive) and 1 (exclusive). This is the core function used by the widget to generate random values before scaling them to the specified range.