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

Not able to handle decimal.Decimal #74

chfw opened this issue Jan 29, 2017 · 0 comments

Not able to handle decimal.Decimal #74

chfw opened this issue Jan 29, 2017 · 0 comments


Copy link

@chfw chfw commented Jan 29, 2017

>>> from decimal import Decimal
>>> import pyexcel as p
>>> s=p.Sheet([[Decimal(11)]])
>>> s
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pyexcel/sheets/", line 557, in __repr__
    result = self.texttable
  File "pyexcel/sources/", line 64, in custom_presenter
  File "pyexcel/sources/", line 78, in write_data
    sheet, **self._keywords)
  File "pyexcel/renderers/", line 48, in render_sheet_to_stream
    self.render_sheet(sheet, **keywords)
  File "pyexcel/renderers/", line 15, in render_sheet
    content = render_text_table(sheet, self._write_title)
  File "pyexcel/renderers/", line 34, in render_text_table
  File "pyexcel/renderers/", line 47, in _cleanse_a_row
    yield(to_format(str, item))
  File "pyexcel/sheets/", line 126, in to_format
    func = CONVERSION_FUNCTIONS[from_type]
KeyError: <class 'decimal.Decimal'>

reference: pyexcel-webwares/django-excel#32 (comment)

@chfw chfw closed this in 78e5190 Feb 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.