emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Xiao-Yong Jin <xj2106@columbia.edu>
To: David Frascone <dave@frascone.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Using Times in org-mode calc?
Date: Wed, 21 Apr 2010 00:12:24 -0400	[thread overview]
Message-ID: <87k4s1php3.fsf@columbia.edu> (raw)
In-Reply-To: <g2i9cf5ced21004200903hdb2773e9ub1a50af90fd2c8c6@mail.gmail.com> (David Frascone's message of "Tue, 20 Apr 2010 12:03:29 -0400")

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 in HH:MM:SS to work right.
> Well -- they work right, but I can't get things to re-display in that format.  And, sometimes math is just screwy.

> For example:

>> Distance |     Time | Time    | Speed | Speed      |
>>   (Miles) | HH:MM:SS | Decimal | (MPH) | (Min/Mile) |
>> ----------+----------+---------+-------+------------|
>>       2.0 |    12:34 | 3:17    |       |            |
>>         3 |    30:45 |         |       |            |
>  #+TBLFM: $3=$2/2

> As you can see the 3:17 is some very strange calculation.  Not sure what it did.  If I use "=$2", it returns 6:17

> It seemed like it was doing something wright, but, now it looks like maybe it just doesn't understand HH:MM:SS format?

> What would be the easiest way to implement something like that table?  Lisp functions? 

Calc uses `:' as a "fraction bar" to represent fractional
numbers.  So as a result,

  12      6
 ---- = ----
  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 

    DEGREE @ MIN ' SEC

I use DEGREE field as hours, thus normal arithmetic works
out of the box.

Hope it helps.
-- 
J    c/*    __o/*
X    <\     * (__
Y    */\      <

      reply	other threads:[~2010-04-21  4:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-20 16:03 Using Times in org-mode calc? David Frascone
2010-04-21  4:12 ` Xiao-Yong Jin [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=87k4s1php3.fsf@columbia.edu \
    --to=xj2106@columbia.edu \
    --cc=dave@frascone.com \
    --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).