RoundToNearest
Type
statement
Summary
Rounds Target to the nearest integer.
Syntax
round <Target>
Description
Replaces Target with the greatest integer less than or equal to Target, or the least integer greater than or equal to Target depending on which is closest. If Target is exactly halfway between two integers, rounds to the one with greatest absolute value, i.e. away from 0.
Parameters
Name | Type | Description |
---|---|---|
Target | An expression that evaluates to a numeric container. |
Examples
variable tNum as Number
put -5.5 into tNum
round tNum -- tNum contains -6