Search code examples
pythonexcelcurrencyopenpyxlcell-formatting

Set openpyxl cell format to currency


I'm creating an excel sheet using openpyxl. Some cells represent monetary values. How can I change the format of a cell to be of type "currency", i.e. I want a "€" symbol to be displayed after the number.


Solution

  • Try setting the format code with your desired format code

    _cell.number_format = '#,##0.00€'