From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao-Yong Jin Subject: Re: Using Times in org-mode calc? Date: Wed, 21 Apr 2010 00:12:24 -0400 Message-ID: <87k4s1php3.fsf@columbia.edu> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O4RJD-0003KO-8n for emacs-orgmode@gnu.org; Wed, 21 Apr 2010 00:13:07 -0400 Received: from [140.186.70.92] (port=60968 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O4RJB-0003JW-Pm for emacs-orgmode@gnu.org; Wed, 21 Apr 2010 00:13:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O4RJA-0001bX-9f for emacs-orgmode@gnu.org; Wed, 21 Apr 2010 00:13:05 -0400 Received: from tarap.cc.columbia.edu ([128.59.29.7]:38570) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O4RJA-0001av-6e for emacs-orgmode@gnu.org; Wed, 21 Apr 2010 00:13:04 -0400 In-Reply-To: (David Frascone's message of "Tue, 20 Apr 2010 12:03:29 -0400") 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: David Frascone Cc: emacs-orgmode@gnu.org On Tue, 20 Apr 2010 12:03:29 -0400, David Frascone wrote: > I'm trying to make a running log, but I can't seem to get times entered i= n HH:MM:SS to work right. > Well -- they work right, but I can't get things to re-display in that for= mat.=C2=A0 And, sometimes math is just screwy. > For example: >> Distance |=C2=A0=C2=A0=C2=A0=C2=A0 Time | Time=C2=A0=C2=A0=C2=A0 | Speed= | Speed=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | >> =C2=A0 (Miles) | HH:MM:SS | Decimal | (MPH) | (Min/Mile) | >> ----------+----------+---------+-------+------------| >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 2.0 |=C2=A0=C2=A0=C2=A0 12:34 | 3:17=C2= =A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 3 |=C2=A0=C2=A0=C2=A0 30:45 |= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 | > =C2=A0#+TBLFM: $3=3D$2/2 > As you can see the 3:17 is some very strange calculation.=C2=A0 Not sure = what it did.=C2=A0 If I use "=3D$2", it returns 6:17 > It seemed like it was doing something wright, but, now it looks like mayb= e it just doesn't understand HH:MM:SS format? > What would be the easiest way to implement something like that table?=C2= =A0 Lisp functions?=C2=A0 Calc uses `:' as a "fraction bar" to represent fractional numbers. So as a result, 12 6 ---- =3D ---- 34 17 I'm not sure what is the correct way to do it. But I use a cheap hack -- abuse the degree notation. Calc understands arc degrees as a form of 12@34'00, that is=20 DEGREE @ MIN ' SEC I use DEGREE field as hours, thus normal arithmetic works out of the box. Hope it helps. --=20 J c/* __o/* X <\ * (__ Y */\ <