Purpose
Rounds values up or down to the nearest factor.
Parameters/Type/Required
Value - The value to be rounded (In/Out)(Yes)
Round Factor - Factor the value will be rounded to (In)(Yes)
Break Point - Point where values rounded up vs down (In)(No)
Limitations
This event rule was created with all three parameters based on the dictionary item MN29D9 which is
based on a digit 29 in length with 9 decimal positions. Therefore, values from very large to very small
in theory can be rounded using this function. However, if you are passing values into the function
based on dictionary items that have, say, a 2 decimal limit, then you can never round to any greater
precision than 1 decimal.
Description
This program will round values to the nearest factor based on a break point. The rounded value is
returned in the same variable that is passed in. The factor is required and tells the program what the
value needs to be rounded to. The break point tells the program at what point the values are rounded up
to the next factor vs. down to the next factor. The break point can be left blank, in which case the
program will assume the break point to be 1/2 the round factor.
Examples
Round values to nearest 100, everything 50 and above going up and below 50 going down
Pass (Value, 100)
11,349.99 -> 11,300.00
11,350.00 -> 11,400.00
Round values to nearest 0.10, everything .02 and above going up and below 0.02 going down
Pass (Value, .1, .02)
45.7199 -> 45.7000
45.7200 -> 45.8000
D0000146 - Round Value Data Structure
Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both |
---|---|---|---|---|
mnValue | MN29D9 | MATH_NUMERIC | NONE | NONE |
This is a generic field used as a work field in Everest. | ||||
mnRoundFactor | MN29D9 | MATH_NUMERIC | NONE | NONE |
This is a generic field used as a work field in Everest. | ||||
mnBreakPoint | MN29D9 | MATH_NUMERIC | NONE | NONE |
This is a generic field used as a work field in Everest. |
None |
None |