How to have localized style when writing cell with xlwt
Posted
by lfagundes
on Stack Overflow
See other posts from Stack Overflow
or by lfagundes
Published on 2010-05-14T17:46:47Z
Indexed on
2010/05/15
13:24 UTC
Read the original article
Hit count: 363
I'm writing an Excel spreadsheet with Python's xlwt and I need numbers to be formatted using "." as thousands separator, as it is in brazilian portuguese language.
I have tried:
style.num_format_str = r'#,##0'
And it sets the thousands separator as ','. If I try setting num_format_str to '#.##0', I'll get number formatted as 1234.000 instead of 1.234. And if I open document in OpenOffice and format cells, I can set the language of the cell to "Portuguese (Brazil)" and then OpenOffice will show the format code as being "#.##0", but I don't find a way to set the cell's language to brazilian portuguese.
Any ideas?
© Stack Overflow or respective owner