Rounds a number with options
The first parameter is a number that you wish to round. This number can be entered directly into the command, or from another location such as a spreadsheet or a global numerical variable.
The second parameter chooses the direction of rounding. There are five options:
The difference between "Smaller" and "Down" comes when the values are negative:
2.4 down = 2
2.4 smaller = 2
-2.4 down = -3
-2.4 smaller = -2
The third parameter is number of decimals to begin the rounding position.
''On End Run Logic
SET gblNumber = 123.456
Round Controlled gblNumber , Nearest , 2
''
The above example will convert 123.456 (from the variable gblNumber) to 123.46
''On End Run Logic
SET gblNumber = 123.456
Round Controlled gblNumber , Down , 1 ''
The above example will convert 123.456 (from the variable gblNumber) to 123.4
''On End Run Logic
SET gblNumber = 123.456
Round Controlled gblNumber , Up , 0 ''
The above example will convert 123.456 (from the variable gblNumber) to 124
''On End Run Logic
SET gblNumber = 123.456
Round Controlled gblNumber , Larger , 2 ''
The above example will convert 123.456 (from the variable gblNumber) to 123.46