RoundingRuleEx
You can use this function for Optiva Workflows and Equations.
Purpose
Round a parameter value to a rule that is defined in the Rounding Rule form.
See the Infor PLM for Process Analysis Administration Guide.
Example
This example shows rounding the value of the TEST parameter using the parameter value rounding code of PVTEST
.
dim dProt as double = 26.5
dim dRoundProt as RoundingRuleResult = RoundingRuleEx(dProt, "PROTEIN", "PVTEST")
messagelist("Passing test:")
if dRoundProt.RoundingOperationResult > 0 then
messagelist("Result is ", dRoundProt.RoundedValue)
else
messagelist("Error rounding, leave value as ", dRoundProt.OriginalValue)
end if
messagelist("Bad Parameter test")
dRoundProt = RoundingRuleEx(dProt, "PROTEINX", "PVTEST")
if dRoundProt.RoundingOperationResult > 0 then
messagelist("Result is ", dRoundProt.RoundedValue)
else
messagelist("Error rounding, leave value as ", dRoundProt.OriginalValue)
end if
messagelist("Bad Rule test")
dim dRoundProtBad2 as RoundingRuleResult = RoundingRuleEx(dProt, "PROTEIN", "PWTEST")
if dRoundProt.RoundingOperationResult > 0 then
messagelist("Result is ", dRoundProt.RoundedValue)
else
messagelist("Error rounding, leave value as ", dRoundProt.OriginalValue)
end if
Return 111