Skip to content
New issue

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

Question: How to validate the min and max value of a float #58

Open
DavidCBerry13 opened this issue Dec 7, 2024 · 3 comments
Open

Question: How to validate the min and max value of a float #58

DavidCBerry13 opened this issue Dec 7, 2024 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@DavidCBerry13
Copy link

I see there are parameters for min_int and max_int and expected to see similar parameters for floats, but didn't see any. Did I miss something? Is there another way to do this? It would seem like min_float and max_float would be nice additions for when dealing with floats.

@smt5541
Copy link
Collaborator

smt5541 commented Dec 7, 2024

Hi! Good question - at least currently, you're able to do that using the func parameter - that said, adding float mins and maxes shouldn't be a big lift

@smt5541 smt5541 added enhancement New feature or request good first issue Good for newcomers labels Dec 7, 2024
@DavidCBerry13
Copy link
Author

Thanks @smt5541 . You confirmed what I was thinking that the way to tackle this today would be to use a func parameter.

I took a look at the code as well and agree it shouldn't be too big of an effort to add in min_float and max_float--would probably pretty much replicate how min_int and max_int are implemented. If I get adventurous over the holidays I'll try to conjure up a PR.

@Ge0rg3
Copy link
Owner

Ge0rg3 commented Dec 9, 2024

It would probably be good here to replace min/max min_int/max_int with just a generic "min" and "max", that will automatically change depending on input type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants