Feature request: Boolean types to have their own write function
See original GitHub issueCurrently, if you write a boolean type it falls under the numeric type and writes it as either a ‘1’ or a ‘0’.
Perhaps a boolean should be explicitly checked for and written as either “TRUE” or “FALSE”
from xlsxwriter import Workbook
wb = Workbook("test.xlsx")
ws = wb.add_worksheet("My Worksheet")
ws.write("A1", True)
wb.close()
Issue Analytics
- State:
- Created 10 years ago
- Comments:14 (6 by maintainers)
Top Results From Across the Web
What is wrong with boolean parameters?
If your function has 17 parameters, you are missing one. To put it short: boolean arguments are the easy way to make the...
Read more >6 Conditionals and Booleans
The values true and false belong to a new type in Pyret, called Boolean.Named for George Boole. While there are an infinitely many...
Read more >Boolean - JavaScript - MDN Web Docs
The Boolean object represents a truth value: true or false.
Read more >Using boolean values in C - Stack Overflow
Assigning an scalar type (arithmetic types and pointer types) to _Bool or bool , if the scalar value is equal to 0 or...
Read more >AND, OR, NOT - Which to Choose? Boolean searches explained
Using the correct Boolean operator can make all the difference in a successful search. AND, OR, NOT. There are three basic Boolean search ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can confirm that i’m also using libreoffice and i see the same behaviour. You seem to be correct @jmcnamara as it sets the value as a boolean, but it nevertheless shows an integer value.
And to confirm, i opened it on excel and it has the expected behaviour. I think libreoffice writer should set the cell format to boolean when it detects a boolean literal as the cell value as it better reflects the intended value
Interestingly, that file has the format set explicitly to “Number / General”, so it does what I would expect - show 1/0. That file requires a similar work-around of changing the format to “Boolean” before TRUE and FALSE appear.