Today I wanted to format a boolean value in a spreadsheet so that true values are shown as “Sì” and false as “No” (italian words for “yes” and “no”). I was easy as librelive describe in Change Boolean to Yes/No instead of True/False – Ask LibreOffice
i suggest basically the same as
m.a.riosv
wrote, but a little better:in
format cells
dialogue fillformat code
input with the following:
[=1]"Yes";[=0]"No";General
– this means it will beyes
ontrue
/1
values,no
onfalse
/0
values and will usegeneral
format otherwise.one may even use the following string to format it as
✓
/✗
instead ofyes
/no
and color differentiation:[GREEN][=1]"✓";[RED][=0]"✗";[BLUE]General;[BLUE]@
this works on libreoffice calc v6.1.5.2 for ubuntu – i’ve tested
i call it “a little bit better” solution because it implements
design by contract
pattern, i.e. if for some unexpected reason the value will be something else than a boolean, then it will be displayed as usual, and not hidden, thus hiding a possible error in design!
But the real gem is finding a reference to design by contract!