Round
This function block rounds a numeric value to a specified number of decimal places. It is a simple numerical utility useful for formatting measurement results, counts, percentages and any numeric outputs prior to display, logging or export.
π₯ Inputs
Number The numeric value to be rounded. (Socket: Number)
π€ Outputs
Number The rounded numeric value. (Socket: Number)
πΉοΈ Controls
Decimals Sets how many decimal places the input number will be rounded to. Enter an integer (for example 0, 1, 2).
π¨ Features
Simple visual control for selecting decimal precision using a text field.
Instantly converts any incoming numeric socket value into a nicely formatted numeric value for display, plotting or export.
Useful to reduce noise in displayed metrics (e.g., shorten long floating point values).
π Usage Instructions
Provide a numeric value to the
Numberinput socket (for example a measurement or a count).Set the desired precision using the
Decimalscontrol.Read the rounded result from the
Numberoutput socket and pass it to display, logging or further processing blocks.
π Evaluation
When evaluated, this function block takes the current numeric input and returns the same value rounded to the number of decimals specified in the Decimals control.
π‘ Tips and Tricks
When showing statistics from image analysis, round numeric outputs from blocks such as
Mean Value of ImageorStd. of Imageto make dashboards and reports easier to read.Round distance values from
Measure Position Distancebefore sending them to displays or logs to avoid overly precise values that are hard to interpret.If you want to store compact numeric logs or CSV files, round values before feeding them to
CSV ExportorData to JSON.For visual plots, feed rounded numbers into
Scopeto make plotted labels and legends clearer.If a detection block returns counts (for example from
Object DetectionorObject Detection - Custom), use this block to format numbers for UIs or records.
π οΈ Troubleshooting
If the output does not change as expected, check that the
Numberinput is receiving a valid numeric value. UseIs NoneorReplace Noneto handle missing inputs before rounding.If non-integer values are entered into the
Decimalscontrol, ensure you provide a valid integer value; otherwise the control may be interpreted in an unexpected way.
Last updated
Was this helpful?