question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: Boolean types to have their own write function

See original GitHub issue

Currently, 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:closed
  • Created 10 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Ambro17commented, Jul 10, 2020

image 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 image

0reactions
reinderiencommented, Jul 10, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found