XenoGuard Documentation

Round

Actions » 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.

[-] Hide
  1. Open the Programming node in the Workspace Explorer.
  2. Open the Number Operation node.
  3. In the Float node, select the Round action.

Parameters:

The action 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 action returns the following results:


NAME
DESCRIPTION
Result Contains the rounded number

Allowed Context Scopes [Fixed, Local, Global]
Allowed Context Types [Variable, Parameter]

Warning

The number type set in the action 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.

An exception occurs when rounding a number with a digit value of less than 0 or greater than 15.
Information 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

See other float operations:

Truncate
Ceiling
Absolute
Floor