Could please someone show an example of applying the number format to the cell. For example, I need scientific format, form would be like '2.45E+05' but I couldn't figure a way how to do that in openpyxl.
I tried in several ways but they are all reporting errors when saving the workbook.
import openpyxl as oxl
wb = oxl.Workbook()
ws = wb.create_sheet(title='testSheet')
_cell = ws.cell('A1')
_cell.style.number_format = '0.00E+00'
nf = oxl.style.NumberFormat.FORMAT_NUMBER_00
_cell.style.number_format = nf
C:\Python27\openpyxl\cell.pyc in is_date(self)
409 return (self.has_style
--> 410 and self.style.number_format.is_date_format()
411 and isinstance(self._value, NUMERIC_TYPES))
AttributeError: 'str' object has no attribute 'is_date_format'
Nevermind, I figured it out, it has to be used like this (if using the same code as before):
_cell.style.number_format.format_code = '0.00E+00'