A Round node is a Calculation node that you can use in a policy model to:
Round a value to a specific number of decimal places. This is called decimal rounding.
-or-
The input of a Round node must be a single, numeric value. The output of a Round node, Answer, contains the rounded value.
When you use decimal rounding, you can specify the number of decimal places to which you want to round the input value. For example, if the input value is 3.51 and you indicate that you want to round to the nearest tenth (by specifying the value 1 in the Digits text box on the Properties window), the input value will be rounded to 3.5.
When you use precision rounding, you can specify the number of digits that you want keep from the input value. For example, if the input value is 7,658,321 and you indicate that you want to keep the first three values (by specifying the value 3 in the Digits text box on the Properties window), the input value will be rounded to 7,660,000 (where the third digit, 5, is rounded to 6, and the remaining digits are changed to 0).
Note: The Round node always rounds values to the nearest number (i.e., you can not specify that it always round values up or down). To round values up or down, you can use a Remainder node with an Add or Subtract node.
The Properties window for a Round node contains the items that are described in the following table.
Item |
Description |
Notes |
---|---|---|
Value section |
Specifies the value that will be rounded. |
You can select |
Digits section |
The value in this section serves a different purpose depending on the option that you select in the Mode section. You can select:
|
You can select If the list in the Mode section contains the value:
Regardless of the values that you specify for the Round node, when you validate the policy logic, only two decimal places are displayed. You can see the actual values by accessing the Properties window for the appropriate node. |
Mode list |
Specifies the type of rounding that the node will perform. |
This list contains the following options:
By default, the Mode list contains the value Decimal rounding and the Digits text box is empty (this is the same as typing 0 [zero]). This means that decimal values will be rounded to the nearest whole number. |
The following example illustrates how you can use the Round node in a policy model to round the value of an OPC Tag reading, represented by the Pressure node, to the nearest ten. Consider the following nodes and connection.
As shown in the following image, you can use the Properties window for the Round node to specify the type of rounding which you want to use. In this example, Precision rounding is selected as the type of rounding and 1 is specified as the number of digits from the input value that will be kept. This means that if, for example, the input to the node is 68, the output value will be 70.
The Round node in this example could be connected to various successor nodes in order to facilitate calculations. You could, for example, connect the Round node to a Case node, and then define a specific case to be executed based on the rounded input (i.e., 10, 20, 30, and so on). Using the Round node in this way facilitates the execution of the Case node by limiting the number of possible inputs.
Copyright © 2018 General Electric Company. All rights reserved.