From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cecil Westerhof Subject: Re: Check on empty does not work Date: Sun, 1 Jun 2014 13:31:44 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c16ba896b6f104fac49f60 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wr3zO-00018e-GC for emacs-orgmode@gnu.org; Sun, 01 Jun 2014 07:31:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wr3zN-00069k-EQ for emacs-orgmode@gnu.org; Sun, 01 Jun 2014 07:31:46 -0400 Received: from mail-qg0-x22b.google.com ([2607:f8b0:400d:c04::22b]:56423) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wr3zN-00069g-8z for emacs-orgmode@gnu.org; Sun, 01 Jun 2014 07:31:45 -0400 Received: by mail-qg0-f43.google.com with SMTP id 63so9251055qgz.30 for ; Sun, 01 Jun 2014 04:31:44 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --001a11c16ba896b6f104fac49f60 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2014-06-01 12:58 GMT+02:00 Michael Brand : > On Sun, Jun 1, 2014 at 12:00 PM, Cecil Westerhof > wrote: > > 2014-06-01 11:50 GMT+02:00 Cecil Westerhof : > >> I am trying the following: > >> #+TBLFM: @-I$4..@+I$4 =3D if("$3" =3D=3D "nan", string(""), $3 - $= 2) ; > %.1f > >> and: > >> #+TBLFM: @-I$4..@+I$4 =3D if("$3" =3D=3D "", 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: @-I$4..@+I$4 =3D if($3 - $2 =3D=3D -$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" =3D=3D "nan" || "$2" =3D=3D "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? > =E2=80=8BThat does what I want. Thanks. --=20 Cecil Westerhof --001a11c16ba896b6f104fac49f60 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
2014= -06-01 12:58 GMT+02:00 Michael Brand <michael.ch.brand@gmail.com<= /a>>:
On Sun, Jun 1, 2014 at 12:00 PM, Cecil Weste= rhof <cldwesterhof@gmail.com> wrote:
> 2014-06-01 11:50 GMT+02:00 Cecil Westerhof <cldwesterhof@gmail.com>:
>> I am trying the following:
>> =C2=A0 =C2=A0 #+TBLFM: @-I$4..@+I$4 =3D if("$3" =3D=3D &= quot;nan", string(""), $3 - $2) ; %.1f
>> and:
>> =C2=A0 =C2=A0 #+TBLFM: @-I$4..@+I$4 =3D if("$3" =3D=3D &= quot;", string(""), $3 - $2) ; %.1f
>>
>> But in both case the fourth field is filled when the third field i= s empty.
>> What am I doing wrong?
>>
>> I am using version 8.2.1.
>
> The following does work:
> =C2=A0 =C2=A0 #+TBLFM: @-I$4..@+I$4 =3D if($3 - $2 =3D=3D -$2, string(= ""), $3 - $2) ;
>
> But is not what is described.
>
> I removed
> =C2=A0 =C2=A0 %.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:

=C2=A0 =C2=A0 `if("$1" =3D=3D "nan" || "$2" = =3D=3D "nan", string(""), $1 + $2); E f-1'
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Sum of the first two columns. =C2=A0When = at least one of the input
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0fields is empty the Org table result fiel= d is set to empty. =C2=A0`E'
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0is required to leave empty fields without= conversion to 0. =C2=A0`f-1'
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0is an optional Calc format string similar= to `%.1f' but leaves
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0empty results empty.

Would this have answered all your questions?

=E2=80=8BThat does what I want. Thanks.

-- Cecil Westerhof
--001a11c16ba896b6f104fac49f60--