emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] Table formula with org-hh:mm-string-to-minutes
@ 2010-10-05 13:59 Sébastien Vauban
  2010-10-05 18:13 ` Štěpán Němec
  2010-10-05 19:11 ` Achim Gratz
  0 siblings, 2 replies; 4+ messages in thread
From: Sébastien Vauban @ 2010-10-05 13:59 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hello,

I use the following table and formulas to convert HH:MM times to fractional
times, so that I can sum up the times (and convert them to money...)

| Task   | *HH:MM* | *Frac* |
|--------+---------+--------|
| Item 1 |   20:27 |  20.45 |
| Item 2 |    2:25 |   2.42 |
| Item 3 |    2:07 |   2.12 |
| Item 4 |    0:19 |   0.00 |
| Item 5 |    0:43 |   0.72 |
| Item 6 |    0:05 |   0.08 |
| Item 7 |    0:32 |   0.53 |
| Item 8 |    0:16 |   0.27 |
|--------+---------+--------|
|        |         |  26.59 |
#+TBLFM: $3='(/ (float (org-hh:mm-string-to-minutes $2)) 60.);%.2f::@5$3=0.00;%.2f::@10$3=vsum(@-I..@-II)

Everything is fine... but the item 4: 19 minutes get converted to 0.00 hour...
Why!?

It's not even because it's a small figure that would be rounded, or some such,
as 0:05 is well converted (to 0.08 hour).

Do you have a hint?

Best regards,
  Seb

-- 
Sébastien Vauban


_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BUG] Table formula with org-hh:mm-string-to-minutes
  2010-10-05 13:59 [BUG] Table formula with org-hh:mm-string-to-minutes Sébastien Vauban
@ 2010-10-05 18:13 ` Štěpán Němec
  2010-10-05 19:11 ` Achim Gratz
  1 sibling, 0 replies; 4+ messages in thread
From: Štěpán Němec @ 2010-10-05 18:13 UTC (permalink / raw)
  To: Sébastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ



Sébastien Vauban <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
writes:

> Hello,
>
> I use the following table and formulas to convert HH:MM times to fractional
> times, so that I can sum up the times (and convert them to money...)
>
> | Task   | *HH:MM* | *Frac* |
> |--------+---------+--------|
> | Item 1 |   20:27 |  20.45 |
> | Item 2 |    2:25 |   2.42 |
> | Item 3 |    2:07 |   2.12 |
> | Item 4 |    0:19 |   0.00 |
> | Item 5 |    0:43 |   0.72 |
> | Item 6 |    0:05 |   0.08 |
> | Item 7 |    0:32 |   0.53 |
> | Item 8 |    0:16 |   0.27 |
> |--------+---------+--------|
> |        |         |  26.59 |
> #+TBLFM: $3='(/ (float (org-hh:mm-string-to-minutes $2))
> 60.);%.2f::@5$3=0.00;%.2f::@10$3=vsum(@-I..@-II)

I don't really understand Calc and Org table formulas, but the
"%.2f::@5$3=0.00;" in there looks pretty suspicious, and removing it
fixes it for me. ;-)

Štěpán

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BUG] Table formula with org-hh:mm-string-to-minutes
  2010-10-05 13:59 [BUG] Table formula with org-hh:mm-string-to-minutes Sébastien Vauban
  2010-10-05 18:13 ` Štěpán Němec
@ 2010-10-05 19:11 ` Achim Gratz
  2010-10-06  8:03   ` Sébastien Vauban
  1 sibling, 1 reply; 4+ messages in thread
From: Achim Gratz @ 2010-10-05 19:11 UTC (permalink / raw)
  To: emacs-orgmode

[repost -- sorry if this turns out a duplicate]

Sébastien Vauban <wxhgmqzgwmuf@spammotel.com>
writes:
> Everything is fine... but the item 4: 19 minutes get converted to 0.00
> hour...  Why!?

Because you told it to: remove ";%.2f::@5$3=0.00" from the formula and
live a happier life.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptations for Waldorf Q V3.00R3 and Q+ V3.54R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BUG] Table formula with org-hh:mm-string-to-minutes
  2010-10-05 19:11 ` Achim Gratz
@ 2010-10-06  8:03   ` Sébastien Vauban
  0 siblings, 0 replies; 4+ messages in thread
From: Sébastien Vauban @ 2010-10-06  8:03 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Achim, Štěpán and Carsten,

Achim Gratz wrote:
> [repost -- sorry if this turns out a duplicate]
>
> Sébastien Vauban <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
> writes:
>> Everything is fine... but the item 4: 19 minutes get converted to 0.00
>> hour... Why!?
>
> Because you told it to: remove ";%.2f::@5$3=0.00" from the formula and live
> a happier life.

Sorry. Stupid from me. Copy/paste of a similar table, but with one
difference...

That proves that I have to use another -- more explicit way -- to void a cell,
by using a SUMIF construct, and having a 0/1 value somewhere else. There has
been a thread on such a thing a couple of weeks ago...

Thanks for your quick answer.

Best regards,
  Seb

-- 
Sébastien Vauban


_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-10-06  8:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-05 13:59 [BUG] Table formula with org-hh:mm-string-to-minutes Sébastien Vauban
2010-10-05 18:13 ` Štěpán Němec
2010-10-05 19:11 ` Achim Gratz
2010-10-06  8:03   ` Sébastien Vauban

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).