Set openpyxl cell format to currency

陌路散爱 提交于 2019-12-21 12:41:37

问题


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.


回答1:


Try setting the format code with your desired format code

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


来源:https://stackoverflow.com/questions/34652300/set-openpyxl-cell-format-to-currency

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!