From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cecil Westerhof Subject: Re: how to clear computed values Date: Wed, 11 Jul 2007 09:22:01 +0200 Message-ID: <1184138521.6283.99.camel@Barebusta.DecebalComp> References: <1184092729.6283.91.camel@Barebusta.DecebalComp> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I8WWS-0000wC-Qx for emacs-orgmode@gnu.org; Wed, 11 Jul 2007 03:22:04 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I8WWS-0000ut-6X for emacs-orgmode@gnu.org; Wed, 11 Jul 2007 03:22:04 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I8WWS-0000ua-0y for emacs-orgmode@gnu.org; Wed, 11 Jul 2007 03:22:04 -0400 Received: from smtp-vbr13.xs4all.nl ([194.109.24.33]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I8WWR-0005hP-7M for emacs-orgmode@gnu.org; Wed, 11 Jul 2007 03:22:03 -0400 Received: from Barebusta.DecebalComp (DecebalComputing.xs4all.nl [213.84.157.201]) by smtp-vbr13.xs4all.nl (8.13.8/8.13.8) with ESMTP id l6B7M2EB075781 for ; Wed, 11 Jul 2007 09:22:02 +0200 (CEST) (envelope-from CecilWesterhof@xs4all.nl) In-Reply-To: <1184092729.6283.91.camel@Barebusta.DecebalComp> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: org-mode Op di, 10-07-2007 te 20:38 +0200, schreef Cecil Westerhof: > I have a table like: > |---------+---------+---------+--------+-------+----------+--------| > | kmstand | km's | prijs/l | liters | prijs | prijs/km | km/l | > |---------+---------+---------+--------+-------+----------+--------| > | 155111 | 0 | | | 0.00 | -0.000 | 0.000 | > | 156146 | 1035 | 102.2 | 62.25 | 63.62 | 6.147 | 16.627 | > | | -156146 | | | 0.00 | -0.000 | 0.000 | > |---------+---------+---------+--------+-------+----------+--------| > #+TBLFM: $2='(and @-1$-1 $1 (- $1 @-1$-1));N::$5='(and $3 $4 (/ (* $3 $4) 100));N%.2f::$6='(and $2 $5 (/ (* $5 100) $2));N%.3f::$7='(and $2 $4 (/ $2 $4));N%.3f > > When there is nothing to display, there is now a '0' displayed, but I > would prefer it to be empty. Is this possible? > Also, why is prijs/km displayed as '-0.000'? > And why is the last field of km's displayed as '-156146'? I expected > '0'. I have been playing a little bit more and made this: |------------+---------+--------+--------+--------+---------+---------+--------+-------+----------+--------| | datum | kmstand | | | | km's | prijs/l | liters | prijs | prijs/km | km/l | |------------+---------+--------+--------+--------+---------+---------+--------+-------+----------+--------| | | 155111 | 155111 | 155111 | 155111 | 0 | | | 0.00 | -0.000 | 0.000 | | 2007-07-09 | 156146 | 155111 | 156146 | 156146 | 1035 | 102.2 | 62.25 | 63.62 | 6.147 | 16.627 | | | | 156146 | 0 | 0 | -156146 | | | 0.00 | -0.000 | 0.000 | | | | 0 | 0 | 0 | 0 | | | 0.00 | -0.000 | 0.000 | |------------+---------+--------+--------+--------+---------+---------+--------+-------+----------+--------| #+TBLFM: $3=@-1$2;N::$4=$2::$5='(and @-1$2 $2);N::$6='(if (and @-1$2 $2) (- $2 @-1$2) (0));N::$9='(and $7 $8 (/ (* $7 $8) 100));N%.2f::$10='(and $6 $9 (/ (* $9 100) $6));N%.3f::$11='(and $6 $8 (/ $6 $8));N%.3f If you look at the km's column, I would expect that in the thirth row 0 would be displayed. (The else part.) But the negative value of @-1$2 is displayed. I think this is a bug? Also when adding the fields between kmstand an km's in the km formula @-1$-1 did not change. I would expect it to change to @-1$-4. Or is there a reason for this behaviour? -- Cecil Westerhof