I'm having trouble writing the currency symbol I want in my currency values with xlsxwriter
.
I followed the tutorial here and I'm able to write out currency values with the correct formatting and a dollar sign (whether this is from the tutorial or excel's default settings I'm not sure).
This works:
money = workbook.add_format({'num_format':'$#,##0.00'})
And it prints out a currency value with the dollar sign.
$1,000.00
But if I try to insert my own currency, let's say R
:
money = workbook.add_format({'num_format':'R#,##0.00'})
I get this:
R1000
How can I set the currency symbol using xlsxwriter?
XlsxWriter vs openpyxl: What are the differences? Developers describe XlsxWriter as "A Python module for creating Excel XLSX files". A Python module for creating Excel XLSX files. On the other hand, openpyxl is detailed as "A Python library to read/write Excel 2010 xlsx/xlsm files".
XlsxWriter is a Python module for writing files in the XLSX file format. It can be used to write text, numbers, and formulas to multiple worksheets. Also, it supports features such as formatting, images, charts, page setup, auto filters, conditional formatting and many others.
Please try:
num_format('"R" #,##0.00')
format.set_num_format()
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