Round Block

The Round block rounds a decimal number to an integer value. You can round a number up, down, or to the nearest integer. You can also truncate a number to a certain number of decimal places.
Choose the Mode


Mode Selector
Inputs
Output

Use the Mode Selector to choose the type of rounding to use. The different modes are described below.
Modes
Round To Nearest


The Round To Nearest, Round Up, and Round Down modes round a decimal number in the Input to an integer value in the Result. Round To Nearest uses standard rounding rules to round to the nearest integer. Round Up always rounds up, and Round Down always rounds down.
Round Up


The Round To Nearest, Round Up, and Round Down modes round a decimal number in the Input to an integer value in the Result. Round To Nearest uses standard rounding rules to round to the nearest integer. Round Up always rounds up, and Round Down always rounds down.
Round Down


The Round To Nearest, Round Up, and Round Down modes round a decimal number in the Input to an integer value in the Result. Round To Nearest uses standard rounding rules to round to the nearest integer. Round Up always rounds up, and Round Down always rounds down.
This table shows example output results.
InputRound To NearestRound UpRound Down
1.2121
1.5221
1.7221
2.0222
2.1232
Truncate


The Truncate mode lets you eliminate any digits past a specified decimal place in a decimal number. Any digits past the Number of Decimals in the Input are eliminated in the Result. No other digits are affected (the output is not rounded).
This table shows example output results.
InputNumber of DecimalsOutput
1.25301
1.25311.2
1.25321.25
1.25361.253
Inputs and Outputs
You can enter the input values directly into the Round block. Alternatively, the values can be supplied by Data Wires from the outputs of other Programming Blocks.
InputTypeNotes
Input NumericNumber to round
Number of Decimals NumericNumber of decimal places to keep in Truncate mode.
The output of the Round Block gives the result of the rounding. To use the output, use a Data Wire to connect it to another Programming Block.
OutputTypeNotes
Result NumericResult of rounding the Input value
Round
Quick links