emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [bug] Negating time changes its value


From: Sebastien Vauban
Subject: [O] [bug] Negating time changes its value
Date: Mon, 30 Apr 2012 16:25:49 +0200
User-agent: Gnus/5.130004 (Ma Gnus v0.4) Emacs/24.1.50 (windows-nt)

Hello,

Taking the opposite of a time (that is, "putting" a minus sign in front of it)
changes its value...

Here, a quick ECM to demonstrate the above:

* Grand total

#+TBLNAME: GrandTot
| Total | 232:11 |

* Other total

#+TBLNAME: OtherTot
| Total | 158:07 |

* Computation

** OK

The "other total time" is to be divided by 2, and substracted from the "grand
total time".

|                          |   Time |
|--------------------------+--------|
| Grand total              | 232:11 |
| - Other total / 2        |  79:03 |
|--------------------------+--------|
| = Total to be considered | 153:08 |
#+TBLFM: 
@2$2=remote(GrandTot,@1$2);T::@3$2=remote(OtherTot,@1$2)/2;T::@address@hidden@3;T

That's correct.

** Not OK

However, I would like to clearly state that the amounts do no add, by having a
minus sign in the time column:

|                          |   Time |
|--------------------------+--------|
| Grand total              | 232:11 |
| - Other total / 2        | -80:56 |
|--------------------------+--------|
| = Total to be considered | 151:15 |
#+TBLFM: 
@2$2=remote(GrandTot,@1$2);T::@3$2=-remote(OtherTot,@1$2)/2;T::@address@hidden@3;T

Whoops! Not the same results...

Other variations also fail:

|                          |   Time |
|--------------------------+--------|
| Grand total              | 232:11 |
| - Other total / 2        | -80:56 |
|--------------------------+--------|
| = Total to be considered | 151:15 |
#+TBLFM: 
@2$2=remote(GrandTot,@1$2);T::@3$2=remote(OtherTot,@1$2)/-2;T::@address@hidden@3;T

or

|                          |   Time |
|--------------------------+--------|
| Grand total              | 232:11 |
| - Other total / 2        | -80:56 |
|--------------------------+--------|
| = Total to be considered | 151:15 |
#+TBLFM: 
@2$2=remote(GrandTot,@1$2);T::@3$2=remote(OtherTot,@1$2)/2*-1;T::@address@hidden@3;T

Best regards,
  Seb

-- 
Sebastien Vauban




reply via email to

[Prev in Thread] Current Thread [Next in Thread]