You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I like this package, but I have problem with floating numbers as for data type float64 limitation, which for my case is rounding and unmarshaling from JSON.
Describe the solution you'd like
Would like to propose implementation math/big to standard evaluation (https://github.com/hyperjumptech/grule-rule-engine/blob/master/pkg/reflectmath.go).
it can be done with something similar like: if left.Type().String() == "big.Float" && right.Type().String() == "big.Float" {
leftValue := left.Interface().(big.Float)
rightValue := right.Interface().(big.Float)
return reflect.ValueOf(leftValue.Cmp(&rightValue) == 1), nil
}
Describe alternatives you've considered
I've considered to create custom function with strings inputs, which will/is #working nicely, but I think above could be nice addition to package.
The text was updated successfully, but these errors were encountered:
Hello,
I like this package, but I have problem with floating numbers as for data type float64 limitation, which for my case is rounding and unmarshaling from JSON.
Describe the solution you'd like
Would like to propose implementation math/big to standard evaluation (https://github.com/hyperjumptech/grule-rule-engine/blob/master/pkg/reflectmath.go).
it can be done with something similar like:
if left.Type().String() == "big.Float" && right.Type().String() == "big.Float" {
leftValue := left.Interface().(big.Float)
rightValue := right.Interface().(big.Float)
return reflect.ValueOf(leftValue.Cmp(&rightValue) == 1), nil
}
Describe alternatives you've considered
I've considered to create custom function with strings inputs, which will/is #working nicely, but I think above could be nice addition to package.
The text was updated successfully, but these errors were encountered: