thygesteffensen / PowerAutomateMockUp

Skeleton to run Power Automate Flows from their JSON descriptions.
MIT License
8 stars 1 forks source link

Figure out how to handle comparison and in general how to handle float/double.. #41

Closed github-actions[bot] closed 1 year ago

github-actions[bot] commented 3 years ago

Figure out how to handle comparison and in general how to handle float/double..

assignee: thygesteffensen

https://github.com/thygesteffensen/PowerAutomateMockUp/blob/4c0eabd2e25193e76262dd58a0ded44b9e0a5f04/PowerAutomateMockUp/ExpressionParser/ValueContainer.cs#L405

                    return thisDict.Count == otherDict.Count && !thisDict.Except(otherDict).Any();
                }
                case ValueType.Integer when other._type == ValueType.Float:
                    var v = (double) _value;
                    return Math.Abs(Math.Floor(v) - other._value) < double.Epsilon;
                case ValueType.Float when other._type == ValueType.Integer:
                {
                    return Math.Abs(Math.Floor(_value) - other._value) < double.Epsilon;
                }
                case ValueType.Float:
                {
                    // TODO: Figure out how to handle comparison and in general how to handle float/double..
                    // assignee: thygesteffensen
                    return Math.Abs(_value - other._value) < 0.01;
                }
                default:
                    return Equals(_value, other._value) && _type == other._type;
            }
imilarity index 98%
ename from PowerAutomateMockUp/FlowParser/ActionExecutors/Implementations/DoUntilActionExecutor.cs
ename to PowerAutomateMockUp/FlowParser/ActionExecutors/Implementations/ControlActions/DoUntilActionExecutor.cs
ndex 195cebc..e519c40 100644
++ b/PowerAutomateMockUp/FlowParser/ActionExecutors/Implementations/ControlActions/DoUntilActionExecutor.cs

3e062b83dd256bb75de176d2beec2342382bf904

thygesteffensen commented 1 year ago

This have been handled and will be solved by: #50