Date: prev next · Thread: first prev next last
2019 Archives by date, by thread · List index

On 5/16/19 11:12 AM, Johnny Rosenberg wrote:
Den tors 16 maj 2019 kl 00:22 skrev Girvin Herr <>:


I am using LibreOffice on Slackware Linux 14.2 (K4.4.75).

I have a database with a text field which may or may not be null. What I
want to do is to prefix a dash "-" before the text if the text field is
not null. At first, I tried this format:


Somewhere, not by me, it got changed to:


However, this does not work. I get the text when not null, but not the
dash in either case.

If I format a cell like your first example and enter a letter in that cell,
let's say ”k”, I get:

If I enter a number, the cell remains blank. Is this the behaviour you are
looking for?

The format string doesn't change if I don't change it.

If I set it to [>0]"";[<0]"";"";"-"@ I get the same result, and I should
since the two means exactly the same thing.

Can you give an example that doesn't work?

Kind regards

Johnny Rosenberg

Is there another way to do this?


Girvin Herr

To unsubscribe e-mail to:
Posting guidelines + more:
List archive:
Privacy Policy:


Thanks for your response.

I should have been more clear in my original posting. I am not trying to do this in Calc. I am trying to do it in Base Report Generator.

I have a text field in the database which I want to prefix with a dash (-) if, and only if, there is text (not NULL) in that field.

None of the examples you gave will work as I expect (and as the number formatting help implies) in my context (with Base Report Generator). No matter how I format it, the result is strange and almost indeterminate. Sometimes if the text field is alpha-numeric, the result is "-" without the text. Other times it is the text without the "-" prefix. Sometimes when the text field is numeric-only, the result is the text without the "-". Sometimes not one of these. As I said, indeterminate results.

Not getting a number when encountered is not what I am looking for. In all cases, if there is text there, I want it to be in the report. Also, I do not want the dash prefix, if there is no text to be in the report.

So, I am not sure what is going on. It almost looks like a bug with the unexpected results. It also appears the formatting for the Report Generator behaves differently than for Calc.



To unsubscribe e-mail to:
Posting guidelines + more:
List archive:
Privacy Policy:


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.