emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Cecil Westerhof <CecilWesterhof@xs4all.nl>
To: org-mode <emacs-orgmode@gnu.org>
Subject: Re: how to clear computed values
Date: Wed, 11 Jul 2007 09:22:01 +0200	[thread overview]
Message-ID: <1184138521.6283.99.camel@Barebusta.DecebalComp> (raw)
In-Reply-To: <1184092729.6283.91.camel@Barebusta.DecebalComp>

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 <CecilWesterhof@xs4all.nl>

      parent reply	other threads:[~2007-07-11  7:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-10 18:38 how to clear computed values Cecil Westerhof
2007-07-11  6:15 ` Carsten Dominik
2007-07-11  8:26   ` Cecil Westerhof
2007-07-11  8:49     ` Carsten Dominik
2007-07-11  9:02       ` Cecil Westerhof
2007-07-11 10:19         ` Carsten Dominik
2007-07-11 11:02           ` Cecil Westerhof
2007-07-11 11:21             ` Carsten Dominik
2007-07-11  7:22 ` Cecil Westerhof [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1184138521.6283.99.camel@Barebusta.DecebalComp \
    --to=cecilwesterhof@xs4all.nl \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).