Round
ActionStep Reference » Programming » Number Operation » Float » Round
This rounds a floating point value to a specified number of digits and stores the rounded number in Result of the Result List. Only the Floating Point data type is allowed.
- Open the Programming node in the Workspace Explorer.
- Open the Number Operation node.
- In the Float node, select the Round ActionStep.
Parameters:
The ActionStep has the following input parameters:
NAME |
DESCRIPTION
|
---|---|
Number Type
|
Specifies the data type to be used for a number
Allowed Context Scope [Fixed] Allowed Value [Floating Point] |
Source
|
The number to be rounded
Allowed Context Scopes [Fixed, Local, Global] Allowed Context Types [Variable, Parameter, Enum] |
Digits
|
The specified place value of a number to be rounded
Allowed Context Scopes [Fixed, Local, Global] Allowed Context Types[Variable, Parameter, Enum] |
Results:
The ActionStep returns the following results:
NAME
|
DESCRIPTION
|
---|---|
Result |
Contains the rounded number
Allowed Context Scopes [Fixed, Local, Global] Allowed Context Types [Variable, Parameter] |
The number type set in the ActionStep Round determines the data type of its Result even if the variables and/or parameters that were set for source and digits are of different data types.
|
To prevent an exception, rounding digits must be between 0 and 15. |
Example (Rounding a converted currency):
This example multiplies the Currency and Conversion variables. Both variables have a Floating Point data type. The product of the variables was set as a number to be rounded by 2 digits. The result of the rounded number is then output via the Message Box.