Preformat to currency and two decimal places in python using xlwt for excel
问题 I have a column heading Fee . Using xlwt in python , I successfully generated the required excel.This column is always blank at the creation of Excel file. Is it possible to have the Fee column preformatted to 'Currency' and 'two decimal places', so that when I write manually in the Fee column of the Excel file after downloading, 23 should change into $23.00 ?? 回答1: I got it working like this: currency_style = xlwt.XFStyle() currency_style.num_format_str = "[$$-409]#,##0.00;-[$$-409]#,##0.00"