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

DecimalWidget should be initialized from text #1035

Closed
andreynovikov opened this issue Nov 20, 2019 · 0 comments
Closed

DecimalWidget should be initialized from text #1035

andreynovikov opened this issue Nov 20, 2019 · 0 comments

Comments

@andreynovikov
Copy link
Contributor

As per doc:

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

When I've changed this line:

return Decimal(value)

to

        return Decimal(force_text(value))

the import of value 1.4 changed from:

1.40399999999999999911182158029987476766109466552734375

to:

1.40

andrewgy8 added a commit that referenced this issue Apr 26, 2020
ZuluPro pushed a commit to ZuluPro/django-import-export that referenced this issue 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

No branches or pull requests

1 participant