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

1824 fix min max #1842

Closed

Conversation

MarquisTheCoder
Copy link
Contributor

What does this change

I rounded the min/max values in the pydecimal function definition

# line: 254 file:providers/python/__init__.py
def pydecimal(
        self,
        left_digits=None,
        right_digits=None,
        positive=False,
        min_value=None,
        max_value=None,
    ):
        """ returns valid decimal when given floating point numbers without changing too much code"""
        min_value = round(min_value)
        max_value = round(max_value)

What was wrong

As stated in issue 1824 when a developer inserts a floating point into the min or max value
this conflicts with pythons in-built randrange function.
#1824

How this fixes it

simple fix just rounds the number of the min or max value because they don't need
to be floating points for this function to work in an consistent manner.

Fixes #...
1824

@stefan6419846
Copy link
Contributor

Could you please add a corresponding test as well and fix the formatting issues detected by black?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants