[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Check on empty does not work
From: |
Michael Brand |
Subject: |
Re: [O] Check on empty does not work |
Date: |
Sun, 1 Jun 2014 12:58:11 +0200 |
Hi Cecil
On Sun, Jun 1, 2014 at 12:00 PM, Cecil Westerhof <address@hidden> wrote:
> 2014-06-01 11:50 GMT+02:00 Cecil Westerhof <address@hidden>:
>> I am trying the following:
>> #+TBLFM: @address@hidden = if("$3" == "nan", string(""), $3 - $2) ; %.1f
>> and:
>> #+TBLFM: @address@hidden = if("$3" == "", string(""), $3 - $2) ; %.1f
>>
>> But in both case the fourth field is filled when the third field is empty.
>> What am I doing wrong?
>>
>> I am using version 8.2.1.
>
> The following does work:
> #+TBLFM: @address@hidden = if($3 - $2 == -$2, string(""), $3 - $2) ;
>
> But is not what is described.
>
> I removed
> %.1f
> because that displays an empty string as 0.0.
>
> Is it possible to use %.1f without making an empty field displayed as 0.0?
I suggest that I will improve the TBLFM example about "nan" in the
manual like this:
`if("$1" == "nan" || "$2" == "nan", string(""), $1 + $2); E f-1'
Sum of the first two columns. When at least one of the input
fields is empty the Org table result field is set to empty. `E'
is required to leave empty fields without conversion to 0. `f-1'
is an optional Calc format string similar to `%.1f' but leaves
empty results empty.
Would this have answered all your questions?
Michael