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 ??
I got it working like this:
currency_style = xlwt.XFStyle()
currency_style.num_format_str = "[$$-409]#,##0.00;-[$$-409]#,##0.00"
sheet.write(row+2, col, val, style=currency_style)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With