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

Initialize Decimal with text value, fix #1035 #1039

Merged

Conversation

andreynovikov
Copy link
Contributor

Problem

As per doc:

>>> Decimal('3.14')
Decimal('3.14')
>>> Decimal(3.14)
Decimal('3.140000000000000124344978758017532527446746826171875')

When Decimal field is initialized from import it gets float value. See updated test case for details (it will fail without this fix).

Solution

Force Decimal initialization with text value.

Acceptance Criteria

Test case updated, no documentation changes required.

@coveralls
Copy link

coveralls commented Nov 21, 2019

Coverage Status

Coverage decreased (-0.07%) to 95.531% when pulling 597c448 on andreynovikov:decimal-field-fix into 3cf5e3f on django-import-export:master.

Copy link
Member

@andrewgy8 andrewgy8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @andreynovikov

@andrewgy8 andrewgy8 merged commit 100a649 into django-import-export:master Apr 26, 2020
andrewgy8 added a commit that referenced this pull request Apr 26, 2020
ZuluPro pushed a commit to ZuluPro/django-import-export that referenced this pull request Dec 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants