Scripting Additions Guide

CHAPTER 2
Scripting Addition Commands
54 Command Definitions
Round 2
The Round command rounds or truncates a number to an integer. It is one of
two commands provided by the Numerics scripting addition.
By default, Round rounds to the nearest number. You may also include an
optional parameter to specify rounding up, down, toward zero, or to the
nearest number.
SYNTAX
round number ¬
[ rounding ( up | down | toward zero | to nearest ) ]
PARAMETER
number The number to round.
Class: Number
See the examples that follow for demonstrations of the possible values of the
rounding parameter.
RESULT
The result is an integer: the rounded value.
EXAMPLES
display dialog "round -3.67: " & (round -3.67) & return & ¬
"round 3.67: " & (round 3.67)
display dialog "round -3.67 up: " & ¬
(round -3.67 rounding up) & return & ¬
"round 3.67 up: " & (round 3.67 rounding up)
display dialog "round -3.67 down: " & ¬
(round -3.67 rounding down) & return & ¬
"round 3.67 down: " & (round 3.6 rounding down)