Function Block ROUND

The function block rounds a floating-point number.

Input IN

The input expects a floating-point number.

Input COMMA

Defines the number of decimal places. The value can also be negative.

Output Q

Returns the rounded value.

Examples

IN COMMA Q
123.995 0 124
5.5 0 6
5.49 0 5
123.995 1 124
5.5 1 5.5
5.49 1 5.5
123.995 -1 120
5.5 -1 10
5.49 -1 10