We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Would be nice to have some utils to convert to a design data type, if error or not the same type then return the default vals:
I have a scenarios where I want to convert a float and want the value to be 0.0 if failed:
0.0
test := mathutil.QuietFloat(math.NaN) //=> test = NaN, I want it to always be a float type instead (0.0 if failed).
The idea...
utils.FloatOrDefault(in any, default float64) test := utils.FloatOrDefault("test", 0.0) //=> Error, return test = 0.0 utils.StringOrDefault(in any, default string) test := utils.StringOrDefault(nil, "hello") //=> Error, return test = "hello" ...
Something like that. you get the idea 🙂 Thanks,
The text was updated successfully, but these errors were encountered:
✨ feat: mathutil - add new func: IntOrDefault, UnitOrDefault, FloatOr…
e906c90
…Default ... and more for convert with default - support for issues #111
Hi @KiddoV added and released on v0.6.12
Sorry, something went wrong.
Nice. Thank you!
inhere
No branches or pull requests
Would be nice to have some utils to convert to a design data type, if error or not the same type then return the default vals:
I have a scenarios where I want to convert a float and want the value to be
0.0
if failed:The idea...
Something like that. you get the idea 🙂
Thanks,
The text was updated successfully, but these errors were encountered: