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

Closed
chfw opened this issue Jan 29, 2017 · 0 comments
Closed

Not able to handle decimal.Decimal #74

chfw opened this issue Jan 29, 2017 · 0 comments

Comments

@chfw
Copy link
Member

@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/sheet.py", line 557, in __repr__
    result = self.texttable
  File "pyexcel/sources/__init__.py", line 64, in custom_presenter
    memory_source.write_data(self)
  File "pyexcel/sources/file_source_output.py", line 78, in write_data
    sheet, **self._keywords)
  File "pyexcel/renderers/factory.py", line 48, in render_sheet_to_stream
    self.render_sheet(sheet, **keywords)
  File "pyexcel/renderers/_texttable.py", line 15, in render_sheet
    content = render_text_table(sheet, self._write_title)
  File "pyexcel/renderers/_texttable.py", line 34, in render_text_table
    table.add_row(list(_cleanse_a_row(data[0])))
  File "pyexcel/renderers/_texttable.py", line 47, in _cleanse_a_row
    yield(to_format(str, item))
  File "pyexcel/sheets/formatters.py", 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
Projects
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.