* [BUG] org-table: time difference delivers wrong results
@ 2011-11-15 21:12 Daniel Bausch
2011-11-23 6:38 ` Daniel Bausch
0 siblings, 1 reply; 6+ messages in thread
From: Daniel Bausch @ 2011-11-15 21:12 UTC (permalink / raw)
To: Orgmode Mailing List
Hello list,
consider the following example:
| A | B | C |
|----------+-----------+-----------|
| 07:11:00 | -08:00:00 | -01:11:00 |
#+TBLFM: $3=$1+$2;T
I think the result in the third column is wrong. I expect 0 hours and 49
minutes, negative (-00:49:00).
The following does not work, too:
| A | C |
|----------+-----------|
| 07:11:00 | -01:11:00 |
#+TBLFM: $2=$1-28800;T
Daniel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [BUG] org-table: time difference delivers wrong results
2011-11-15 21:12 [BUG] org-table: time difference delivers wrong results Daniel Bausch
@ 2011-11-23 6:38 ` Daniel Bausch
2011-11-23 9:00 ` Martyn Jago
0 siblings, 1 reply; 6+ messages in thread
From: Daniel Bausch @ 2011-11-23 6:38 UTC (permalink / raw)
To: emacs-orgmode
Anyone? It might be a duplicate of what Gustav Wiktröm reported on 1st of
September, but his problem was not resolved, either.
Daniel
Am Dienstag 15. November 2011, 22:12:45 schrieb Daniel Bausch:
> Hello list,
>
> consider the following example:
> | A | B | C |
> |
> |----------+-----------+-----------|
> |
> | 07:11:00 | -08:00:00 | -01:11:00 |
>
> #+TBLFM: $3=$1+$2;T
>
> I think the result in the third column is wrong. I expect 0 hours and 49
> minutes, negative (-00:49:00).
>
> The following does not work, too:
> | A | C |
> |
> |----------+-----------|
> |
> | 07:11:00 | -01:11:00 |
>
> #+TBLFM: $2=$1-28800;T
>
> Daniel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [BUG] org-table: time difference delivers wrong results
2011-11-23 6:38 ` Daniel Bausch
@ 2011-11-23 9:00 ` Martyn Jago
2011-11-23 9:13 ` Martyn Jago
0 siblings, 1 reply; 6+ messages in thread
From: Martyn Jago @ 2011-11-23 9:00 UTC (permalink / raw)
To: emacs-orgmode
Daniel Bausch <DanielBausch@gmx.de> writes:
> Anyone? It might be a duplicate of what Gustav Wiktröm reported on 1st of
> September, but his problem was not resolved, either.
>
> Daniel
>
> Am Dienstag 15. November 2011, 22:12:45 schrieb Daniel Bausch:
>> Hello list,
>>
>> consider the following example:
>> | A | B | C |
>> |
>> |----------+-----------+-----------|
>> |
>> | 07:11:00 | -08:00:00 | -01:11:00 |
>>
>> #+TBLFM: $3=$1+$2;T
[...]
At first I wondered if Calc was treating these numbers as angles
(degrees, minutes, seconds) but I really can't explain these results:
| Data 1 | Data 2 | Total |
|----------+----------+-----------|
| 00:00:00 | 00:00:00 | 00:00:00 |
| 00:00:00 | 00:00:01 | -01:59:59 |
| 00:00:00 | 00:00:02 | -01:58:58 |
| 00:00:00 | 00:00:03 | -01:59:57 |
| 00:00:00 | 00:00:04 | 00:00:00 |
| 00:00:00 | 00:00:05 | -01:59:55 |
| 00:00:00 | 00:00:06 | -01:58:58 |
| 00:00:00 | 00:00:07 | -01:59:53 |
| 00:00:00 | 00:00:08 | 00:00:00 |
| 00:00:00 | 00:00:09 | -01:59:51 |
| 00:00:00 | 00:00:10 | -01:58:58 |
| 00:00:00 | 00:00:11 | -01:59:49 |
| 00:00:00 | 00:00:12 | 00:00:00 |
| 00:00:00 | 00:00:13 | -01:59:47 |
| 00:00:00 | 00:00:14 | -01:58:58 |
| 00:00:00 | 00:00:15 | -01:59:45 |
#+TBLFM: @2$3=$1-$2;T::@3$3=$1-$2;T;@4$3=$1-$2;T::@5$3=$1-$2;T;@6$3=$1-$2;T::@7$3=$1-$2;T;@8$3=$1-$2;T::@9$3=$1-$2;T;@10$3=$1-$2;T::@11$3=$1-$2;T;@12$3=$1-$2;T::@13$3=$1-$2;T;@14$3=$1-$2;T::@15$3=$1-$2;T;@16$3=$1-$2;T::@17$3=$1-$2;T
| Data 1 | Data 2 | Total |
|----------+----------+-----------|
| 00:00:00 | 00:00:16 | -01:59:44 |
| 00:00:00 | 00:00:17 | -01:59:43 |
| 00:00:00 | 00:00:18 | -01:58:58 |
| 00:00:00 | 00:00:19 | -01:59:41 |
| 00:00:00 | 00:00:20 | 00:00:00 |
| 00:00:00 | 00:00:21 | -01:59:39 |
| 00:00:00 | 00:00:22 | -01:58:58 |
| 00:00:00 | 00:00:23 | -01:59:37 |
| 00:00:00 | 00:00:24 | 00:00:00 |
| 00:00:00 | 00:00:25 | -01:59:35 |
| 00:00:00 | 00:00:26 | -01:58:58 |
| 00:00:00 | 00:00:27 | -01:59:33 |
| 00:00:00 | 00:00:28 | 00:00:00 |
| 00:00:00 | 00:00:29 | -01:59:31 |
| 00:00:00 | 00:00:30 | -01:58:58 |
| 00:00:00 | 00:00:31 | -01:59:29 |
#+TBLFM: @2$3=$1-$2;T::@3$3=$1-$2;T;@4$3=$1-$2;T::@5$3=$1-$2;T;@6$3=$1-$2;T::@7$3=$1-$2;T;@8$3=$1-$2;T::@9$3=$1-$2;T;@10$3=$1-$2;T::@11$3=$1-$2;T;@12$3=$1-$2;T::@13$3=$1-$2;T;@14$3=$1-$2;T::@15$3=$1-$2;T;@16$3=$1-$2;T::@17$3=$1-$2;T
| Data 1 | Data 2 | Total |
|----------+----------+-----------|
| 00:00:00 | 00:00:59 | -01:59:01 |
| 00:00:00 | 00:01:00 | -01:59:00 |
| 00:00:00 | 00:01:01 | -01:58:58 |
| 00:00:00 | 00:01:02 | -01:58:58 |
| 00:00:00 | 00:01:03 | 00:00:00 |
| 00:00:00 | 00:01:04 | -01:58:56 |
| 00:00:00 | 00:01:05 | -01:58:58 |
| 00:00:00 | 00:01:06 | -01:58:54 |
| 00:00:00 | 00:01:07 | 00:00:00 |
| 00:00:00 | 00:01:08 | -01:58:52 |
| 00:00:00 | 00:01:09 | -01:58:58 |
| 00:00:00 | 00:01:10 | -01:58:50 |
| 00:00:00 | 00:01:11 | 00:00:00 |
| 00:00:00 | 00:01:12 | -01:58:48 |
| 00:00:00 | 00:01:13 | -01:58:58 |
| 00:00:00 | 00:01:14 | -01:58:46 |
#+TBLFM: @2$3=$1-$2;T::@3$3=$1-$2;T;@4$3=$1-$2;T::@5$3=$1-$2;T;@6$3=$1-$2;T::@7$3=$1-$2;T;@8$3=$1-$2;T::@9$3=$1-$2;T;@10$3=$1-$2;T::@11$3=$1-$2;T;@12$3=$1-$2;T::@13$3=$1-$2;T;@14$3=$1-$2;T::@15$3=$1-$2;T;@16$3=$1-$2;T::@17$3=$1-$2;T
Best, Martyn
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [BUG] org-table: time difference delivers wrong results
2011-11-23 9:00 ` Martyn Jago
@ 2011-11-23 9:13 ` Martyn Jago
2011-11-23 10:23 ` Nick Dokos
0 siblings, 1 reply; 6+ messages in thread
From: Martyn Jago @ 2011-11-23 9:13 UTC (permalink / raw)
To: emacs-orgmode
Martyn Jago <martyn.jago@btinternet.com> writes:
Apologies I had a typo - please ignore the previous mail. So this looks more sensible:
> Daniel Bausch <DanielBausch@gmx.de> writes:
>
>> Anyone? It might be a duplicate of what Gustav Wiktröm reported on 1st of
>> September, but his problem was not resolved, either.
>>
>> Daniel
>>
>> Am Dienstag 15. November 2011, 22:12:45 schrieb Daniel Bausch:
>>> Hello list,
>>>
>>> consider the following example:
>>> | A | B | C |
>>> |
>>> |----------+-----------+-----------|
>>> |
>>> | 07:11:00 | -08:00:00 | -01:11:00 |
>>>
>>> #+TBLFM: $3=$1+$2;T
>
> [...]
| Data 1 | Data 2 | Total |
|----------+----------+-----------|
| 00:00:00 | 00:00:00 | 00:00:00 |
| 00:00:00 | 00:00:01 | -01:59:59 |
| 00:00:00 | 00:00:02 | -01:59:58 |
| 00:00:00 | 00:00:03 | -01:59:57 |
| 00:00:00 | 00:00:04 | -01:59:56 |
| 00:00:00 | 00:00:05 | -01:59:55 |
| 00:00:00 | 00:00:06 | -01:59:54 |
| 00:00:00 | 00:00:07 | -01:59:53 |
| 00:00:00 | 00:00:08 | -01:59:52 |
| 00:00:00 | 00:00:09 | -01:59:51 |
| 00:00:00 | 00:00:10 | -01:59:50 |
| 00:00:00 | 00:00:11 | -01:59:49 |
| 00:00:00 | 00:00:12 | -01:59:48 |
| 00:00:00 | 00:00:13 | -01:59:47 |
| 00:00:00 | 00:00:14 | -01:59:46 |
| 00:00:00 | 00:00:15 | -01:59:45 |
#+TBLFM: @2$3=$1-$2;T::@3$3=$1-$2;T::@4$3=$1-$2;T::@5$3=$1-$2;T::@6$3=$1-$2;T::@7$3=$1-$2;T::@8$3=$1-$2;T::@9$3=$1-$2;T::@10$3=$1-$2;T::@11$3=$1-$2;T::@12$3=$1-$2;T::@13$3=$1-$2;T::@14$3=$1-$2;T::@15$3=$1-$2;T::@16$3=$1-$2;T::@17$3=$1-$2;T
| Data 1 | Data 2 | Total |
|----------+----------+-----------|
| 00:00:00 | 00:00:16 | -01:59:44 |
| 00:00:00 | 00:00:17 | -01:59:43 |
| 00:00:00 | 00:00:18 | -01:59:42 |
| 00:00:00 | 00:00:19 | -01:59:41 |
| 00:00:00 | 00:00:20 | -01:59:40 |
| 00:00:00 | 00:00:21 | -01:59:39 |
| 00:00:00 | 00:00:22 | -01:59:38 |
| 00:00:00 | 00:00:23 | -01:59:37 |
| 00:00:00 | 00:00:24 | -01:59:36 |
| 00:00:00 | 00:00:25 | -01:59:35 |
| 00:00:00 | 00:00:26 | -01:59:34 |
| 00:00:00 | 00:00:27 | -01:59:33 |
| 00:00:00 | 00:00:28 | -01:59:32 |
| 00:00:00 | 00:00:29 | -01:59:31 |
| 00:00:00 | 00:00:30 | -01:59:30 |
| 00:00:00 | 00:00:31 | -01:59:29 |
#+TBLFM: @2$3=$1-$2;T::@3$3=$1-$2;T::@4$3=$1-$2;T::@5$3=$1-$2;T::@6$3=$1-$2;T::@7$3=$1-$2;T::@8$3=$1-$2;T::@9$3=$1-$2;T::@10$3=$1-$2;T::@11$3=$1-$2;T::@12$3=$1-$2;T::@13$3=$1-$2;T::@14$3=$1-$2;T::@15$3=$1-$2;T::@16$3=$1-$2;T::@17$3=$1-$2;T
| Data 1 | Data 2 | Total |
|----------+----------+-----------|
| 00:00:00 | 00:00:59 | -01:59:01 |
| 00:00:00 | 00:01:00 | -01:59:00 |
| 00:00:00 | 00:01:01 | -01:58:59 |
| 00:00:00 | 00:01:02 | -01:58:58 |
| 00:00:00 | 00:01:03 | -01:58:57 |
| 00:00:00 | 00:01:04 | -01:58:56 |
| 00:00:00 | 00:01:05 | -01:58:55 |
| 00:00:00 | 00:01:06 | -01:58:54 |
| 00:00:00 | 00:01:07 | -01:58:53 |
| 00:00:00 | 00:01:08 | -01:58:52 |
| 00:00:00 | 00:01:09 | -01:58:51 |
| 00:00:00 | 00:01:10 | -01:58:50 |
| 00:00:00 | 00:01:11 | -01:58:49 |
| 00:00:00 | 00:01:12 | -01:58:48 |
| 00:00:00 | 00:01:13 | -01:58:47 |
| 00:00:00 | 00:01:14 | -01:58:46 |
#+TBLFM: @2$3=$1-$2;T::@3$3=$1-$2;T::@4$3=$1-$2;T::@5$3=$1-$2;T::@6$3=$1-$2;T::@7$3=$1-$2;T::@8$3=$1-$2;T::@9$3=$1-$2;T::@10$3=$1-$2;T::@11$3=$1-$2;T::@12$3=$1-$2;T::@13$3=$1-$2;T::@14$3=$1-$2;T::@15$3=$1-$2;T::@16$3=$1-$2;T::@17$3=$1-$2;T
Best, Martyn
--
I _will_ engage brain before posting to the ML :(
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [BUG] org-table: time difference delivers wrong results
2011-11-23 9:13 ` Martyn Jago
@ 2011-11-23 10:23 ` Nick Dokos
2011-11-23 12:11 ` Daniel Bausch
0 siblings, 1 reply; 6+ messages in thread
From: Nick Dokos @ 2011-11-23 10:23 UTC (permalink / raw)
To: Martyn Jago; +Cc: nicholas.dokos, emacs-orgmode
Martyn Jago <martyn.jago@btinternet.com> wrote:
> Martyn Jago <martyn.jago@btinternet.com> writes:
>
> Apologies I had a typo - please ignore the previous mail. So this looks more sensible:
>
> > Daniel Bausch <DanielBausch@gmx.de> writes:
> >
> >> Anyone? It might be a duplicate of what Gustav Wiktrom reported on 1st of
> >> September, but his problem was not resolved, either.
> >>
> >> Daniel
> >>
> >> Am Dienstag 15. November 2011, 22:12:45 schrieb Daniel Bausch:
> >>> Hello list,
> >>>
> >>> consider the following example:
> >>> | A | B | C |
> >>> |
> >>> |----------+-----------+-----------|
> >>> |
> >>> | 07:11:00 | -08:00:00 | -01:11:00 |
> >>>
> >>> #+TBLFM: $3=$1+$2;T
> >
> > [...]
>
>
>
>
> | Data 1 | Data 2 | Total |
> |----------+----------+-----------|
> | 00:00:00 | 00:00:00 | 00:00:00 |
> | 00:00:00 | 00:00:01 | -01:59:59 |
> | 00:00:00 | 00:00:02 | -01:59:58 |
> | 00:00:00 | 00:00:03 | -01:59:57 |
> | 00:00:00 | 00:00:04 | -01:59:56 |
> | 00:00:00 | 00:00:05 | -01:59:55 |
> | 00:00:00 | 00:00:06 | -01:59:54 |
> | 00:00:00 | 00:00:07 | -01:59:53 |
> | 00:00:00 | 00:00:08 | -01:59:52 |
> | 00:00:00 | 00:00:09 | -01:59:51 |
> | 00:00:00 | 00:00:10 | -01:59:50 |
> | 00:00:00 | 00:00:11 | -01:59:49 |
> | 00:00:00 | 00:00:12 | -01:59:48 |
> | 00:00:00 | 00:00:13 | -01:59:47 |
> | 00:00:00 | 00:00:14 | -01:59:46 |
> | 00:00:00 | 00:00:15 | -01:59:45 |
> #+TBLFM: @2$3=$1-$2;T::@3$3=$1-$2;T::@4$3=$1-$2;T::@5$3=$1-$2;T::@6$3=$1-$2;T::@7$3=$1-$2;T::@8$3=$1-$2;T::@9$3=$1-$2;T::@10$3=$1-$2;T::@11$3=$1-$2;T::@12$3=$1-$2;T::@13$3=$1-$2;T::@14$3=$1-$2;T::@15$3=$1-$2;T::@16$3=$1-$2;T::@17$3=$1-$2;T
>
> | Data 1 | Data 2 | Total |
> |----------+----------+-----------|
> | 00:00:00 | 00:00:16 | -01:59:44 |
> | 00:00:00 | 00:00:17 | -01:59:43 |
> | 00:00:00 | 00:00:18 | -01:59:42 |
> | 00:00:00 | 00:00:19 | -01:59:41 |
> | 00:00:00 | 00:00:20 | -01:59:40 |
> | 00:00:00 | 00:00:21 | -01:59:39 |
> | 00:00:00 | 00:00:22 | -01:59:38 |
> | 00:00:00 | 00:00:23 | -01:59:37 |
> | 00:00:00 | 00:00:24 | -01:59:36 |
> | 00:00:00 | 00:00:25 | -01:59:35 |
> | 00:00:00 | 00:00:26 | -01:59:34 |
> | 00:00:00 | 00:00:27 | -01:59:33 |
> | 00:00:00 | 00:00:28 | -01:59:32 |
> | 00:00:00 | 00:00:29 | -01:59:31 |
> | 00:00:00 | 00:00:30 | -01:59:30 |
> | 00:00:00 | 00:00:31 | -01:59:29 |
> #+TBLFM: @2$3=$1-$2;T::@3$3=$1-$2;T::@4$3=$1-$2;T::@5$3=$1-$2;T::@6$3=$1-$2;T::@7$3=$1-$2;T::@8$3=$1-$2;T::@9$3=$1-$2;T::@10$3=$1-$2;T::@11$3=$1-$2;T::@12$3=$1-$2;T::@13$3=$1-$2;T::@14$3=$1-$2;T::@15$3=$1-$2;T::@16$3=$1-$2;T::@17$3=$1-$2;T
>
> | Data 1 | Data 2 | Total |
> |----------+----------+-----------|
> | 00:00:00 | 00:00:59 | -01:59:01 |
> | 00:00:00 | 00:01:00 | -01:59:00 |
> | 00:00:00 | 00:01:01 | -01:58:59 |
> | 00:00:00 | 00:01:02 | -01:58:58 |
> | 00:00:00 | 00:01:03 | -01:58:57 |
> | 00:00:00 | 00:01:04 | -01:58:56 |
> | 00:00:00 | 00:01:05 | -01:58:55 |
> | 00:00:00 | 00:01:06 | -01:58:54 |
> | 00:00:00 | 00:01:07 | -01:58:53 |
> | 00:00:00 | 00:01:08 | -01:58:52 |
> | 00:00:00 | 00:01:09 | -01:58:51 |
> | 00:00:00 | 00:01:10 | -01:58:50 |
> | 00:00:00 | 00:01:11 | -01:58:49 |
> | 00:00:00 | 00:01:12 | -01:58:48 |
> | 00:00:00 | 00:01:13 | -01:58:47 |
> | 00:00:00 | 00:01:14 | -01:58:46 |
> #+TBLFM: @2$3=$1-$2;T::@3$3=$1-$2;T::@4$3=$1-$2;T::@5$3=$1-$2;T::@6$3=$1-$2;T::@7$3=$1-$2;T::@8$3=$1-$2;T::@9$3=$1-$2;T::@10$3=$1-$2;T::@11$3=$1-$2;T::@12$3=$1-$2;T::@13$3=$1-$2;T::@14$3=$1-$2;T::@15$3=$1-$2;T::@16$3=$1-$2;T::@17$3=$1-$2;T
>
> Best, Martyn
>
> --
>
> I _will_ engage brain before posting to the ML :(
>
>
I can't see straight at this time of the night, but aren't all these formulas equivalent to
a column formula?
#+TBLFM: $3 = $1 - $2;T
Assuming that's the case, the problem is that org-table-time-to-string assumes that it is given
a positive number and mishandles negative numbers, eg. the first row in the last table invokes:
,----
| (org-table-time-seconds-to-string -59 nil)
| "-01:59:01"
`----
I didn't check carefully, but it looks as if the other-way function,
org-table-time-string-to-seconds, deals correctly with "negative" time
strings.
Nick
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [BUG] org-table: time difference delivers wrong results
2011-11-23 10:23 ` Nick Dokos
@ 2011-11-23 12:11 ` Daniel Bausch
0 siblings, 0 replies; 6+ messages in thread
From: Daniel Bausch @ 2011-11-23 12:11 UTC (permalink / raw)
To: emacs-orgmode
What may be a leading hint is that even
| -28799 | -08:00:01 |
#+TBLFM: $2=$1;T
does not deliver correct results. It should deliver -07:59:59.
Daniel
Am Mittwoch 23. November 2011, 11:23:49 schrieb Nick Dokos:
> Martyn Jago <martyn.jago@btinternet.com> wrote:
> > Martyn Jago <martyn.jago@btinternet.com> writes:
> >
> > Apologies I had a typo - please ignore the previous mail. So this looks
more sensible:
> > > Daniel Bausch <DanielBausch@gmx.de> writes:
> > >> Anyone? It might be a duplicate of what Gustav Wiktrom reported on
> > >> 1st of September, but his problem was not resolved, either.
> > >>
> > >> Daniel
> > >>
> > >> Am Dienstag 15. November 2011, 22:12:45 schrieb Daniel Bausch:
> > >>> Hello list,
> > >>>
> > >>> consider the following example:
> > >>> | A | B | C |
> > >>> |
> > >>> |----------+-----------+-----------|
> > >>> |
> > >>> | 07:11:00 | -08:00:00 | -01:11:00 |
> > >>>
> > >>> #+TBLFM: $3=$1+$2;T
> > >
> > > [...]
> > >
> > | Data 1 | Data 2 | Total |
> > |
> > |----------+----------+-----------|
> > |
> > | 00:00:00 | 00:00:00 | 00:00:00 |
> > | 00:00:00 | 00:00:01 | -01:59:59 |
> > | 00:00:00 | 00:00:02 | -01:59:58 |
> > | 00:00:00 | 00:00:03 | -01:59:57 |
> > | 00:00:00 | 00:00:04 | -01:59:56 |
> > | 00:00:00 | 00:00:05 | -01:59:55 |
> > | 00:00:00 | 00:00:06 | -01:59:54 |
> > | 00:00:00 | 00:00:07 | -01:59:53 |
> > | 00:00:00 | 00:00:08 | -01:59:52 |
> > | 00:00:00 | 00:00:09 | -01:59:51 |
> > | 00:00:00 | 00:00:10 | -01:59:50 |
> > | 00:00:00 | 00:00:11 | -01:59:49 |
> > | 00:00:00 | 00:00:12 | -01:59:48 |
> > | 00:00:00 | 00:00:13 | -01:59:47 |
> > | 00:00:00 | 00:00:14 | -01:59:46 |
> > | 00:00:00 | 00:00:15 | -01:59:45 |
> >
> > #+TBLFM:
> > @2$3=$1-$2;T::@3$3=$1-$2;T::@4$3=$1-$2;T::@5$3=$1-$2;T::@6$3=$1-$2;T::@7
> > $3=$1-$2;T::@8$3=$1-$2;T::@9$3=$1-$2;T::@10$3=$1-$2;T::@11$3=$1-$2;T::@12
> > $3=$1-$2;T::@13$3=$1-$2;T::@14$3=$1-$2;T::@15$3=$1-$2;T::@16$3=$1-$2;T::@
> > 17$3=$1-$2;T
> >
> > | Data 1 | Data 2 | Total |
> > |
> > |----------+----------+-----------|
> > |
> > | 00:00:00 | 00:00:16 | -01:59:44 |
> > | 00:00:00 | 00:00:17 | -01:59:43 |
> > | 00:00:00 | 00:00:18 | -01:59:42 |
> > | 00:00:00 | 00:00:19 | -01:59:41 |
> > | 00:00:00 | 00:00:20 | -01:59:40 |
> > | 00:00:00 | 00:00:21 | -01:59:39 |
> > | 00:00:00 | 00:00:22 | -01:59:38 |
> > | 00:00:00 | 00:00:23 | -01:59:37 |
> > | 00:00:00 | 00:00:24 | -01:59:36 |
> > | 00:00:00 | 00:00:25 | -01:59:35 |
> > | 00:00:00 | 00:00:26 | -01:59:34 |
> > | 00:00:00 | 00:00:27 | -01:59:33 |
> > | 00:00:00 | 00:00:28 | -01:59:32 |
> > | 00:00:00 | 00:00:29 | -01:59:31 |
> > | 00:00:00 | 00:00:30 | -01:59:30 |
> > | 00:00:00 | 00:00:31 | -01:59:29 |
> >
> > #+TBLFM:
> > @2$3=$1-$2;T::@3$3=$1-$2;T::@4$3=$1-$2;T::@5$3=$1-$2;T::@6$3=$1-$2;T::@7
> > $3=$1-$2;T::@8$3=$1-$2;T::@9$3=$1-$2;T::@10$3=$1-$2;T::@11$3=$1-$2;T::@12
> > $3=$1-$2;T::@13$3=$1-$2;T::@14$3=$1-$2;T::@15$3=$1-$2;T::@16$3=$1-$2;T::@
> > 17$3=$1-$2;T
> >
> > | Data 1 | Data 2 | Total |
> > |
> > |----------+----------+-----------|
> > |
> > | 00:00:00 | 00:00:59 | -01:59:01 |
> > | 00:00:00 | 00:01:00 | -01:59:00 |
> > | 00:00:00 | 00:01:01 | -01:58:59 |
> > | 00:00:00 | 00:01:02 | -01:58:58 |
> > | 00:00:00 | 00:01:03 | -01:58:57 |
> > | 00:00:00 | 00:01:04 | -01:58:56 |
> > | 00:00:00 | 00:01:05 | -01:58:55 |
> > | 00:00:00 | 00:01:06 | -01:58:54 |
> > | 00:00:00 | 00:01:07 | -01:58:53 |
> > | 00:00:00 | 00:01:08 | -01:58:52 |
> > | 00:00:00 | 00:01:09 | -01:58:51 |
> > | 00:00:00 | 00:01:10 | -01:58:50 |
> > | 00:00:00 | 00:01:11 | -01:58:49 |
> > | 00:00:00 | 00:01:12 | -01:58:48 |
> > | 00:00:00 | 00:01:13 | -01:58:47 |
> > | 00:00:00 | 00:01:14 | -01:58:46 |
> >
> > #+TBLFM:
> > @2$3=$1-$2;T::@3$3=$1-$2;T::@4$3=$1-$2;T::@5$3=$1-$2;T::@6$3=$1-$2;T::@7
> > $3=$1-$2;T::@8$3=$1-$2;T::@9$3=$1-$2;T::@10$3=$1-$2;T::@11$3=$1-$2;T::@12
> > $3=$1-$2;T::@13$3=$1-$2;T::@14$3=$1-$2;T::@15$3=$1-$2;T::@16$3=$1-$2;T::@
> > 17$3=$1-$2;T
> >
> > Best, Martyn
> >
> > --
> >
> > I _will_ engage brain before posting to the ML :(
>
> I can't see straight at this time of the night, but aren't all these
> formulas equivalent to a column formula?
>
> #+TBLFM: $3 = $1 - $2;T
>
> Assuming that's the case, the problem is that org-table-time-to-string
> assumes that it is given a positive number and mishandles negative
> numbers, eg. the first row in the last table invokes:
>
> ,----
>
> | (org-table-time-seconds-to-string -59 nil)
> | "-01:59:01"
>
> `----
>
>
> I didn't check carefully, but it looks as if the other-way function,
> org-table-time-string-to-seconds, deals correctly with "negative" time
> strings.
>
> Nick
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-11-23 12:11 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-15 21:12 [BUG] org-table: time difference delivers wrong results Daniel Bausch
2011-11-23 6:38 ` Daniel Bausch
2011-11-23 9:00 ` Martyn Jago
2011-11-23 9:13 ` Martyn Jago
2011-11-23 10:23 ` Nick Dokos
2011-11-23 12:11 ` Daniel Bausch
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).