Hello,Consider the following test code:
a!localVariables( local!Torerance_Name:"Mean", local!test_0: and( local!Torerance_Name = "Mean", "15.0" ), local!test_1: and( local!Torerance_Name = "Mean", "8.2" ) )
Discussion posts and replies are publicly visible
If the goal is “non-zero value” plus the Torerance_Name being “Mean”, they should:
Torerance_Name
Use numeric types, not strings, when testing numbers
Or compare the string explicitly, e.g. check if the string is not "0" or not empty or convert it to number and see if it's > 0
"0"
Some example fixes:
a!localVariables( local!Torerance_Name: "Mean", local!value: 15.0, /* numeric, not string */ local!test_correct: and( local!Torerance_Name = "Mean", local!value > 0 ) )
Or if the value is coming in as a string, convert it:
a!localVariables( local!Torerance_Name: "Mean", local!valueString: "8.2", local!value: todecimal(local!valueString, 0), /* or appropriate function to convert or parse */ local!test_correct: and( local!Torerance_Name = "Mean", local!value > 0 ) )
Or if the string is just being tested for being non-empty or non-zero in string form:
a!localVariables( local!Torerance_Name: "Mean", local!valueStrinacg: "8.2", local!test_correct: and( local!Torerance_Name = "Mean", local!valueString <> "" , local!valueString <> "0" ) )