unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Alexis Roda <alexis.roda.villalonga@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: How to get hours from hh:mm
Date: Thu, 14 Jun 2007 21:06:31 +0200	[thread overview]
Message-ID: <467191B7.8010001@gmail.com> (raw)
In-Reply-To: <873b0uie6z.fsf@thalassa.lan.informatimago.com>

En/na Pascal Bourguignon ha escrit:
> Cecil Westerhof <dummy@dummy.nl> writes:
> 
>> Pascal Bourguignon wrote:
>>
>>> Cecil Westerhof <dummy@dummy.nl> writes:
>>>
>>>> I have a table in org-mode with time needed to travel from A to B an the
>>>> number of km. I would like to get the average speed. How do I convert a
>>>> time? For example 0:45 becomes 0.75.
>>> How do you know that 0:45 becomes 0.75?
>>>
>>> How did you do it?
>> I did not. I want. 0:45 is three quarters of an hour, so in mathematical
>> notation 0.75.

Something like this could be helpful:

(defun time100(time)
   (let ((timelist (split-string time ":")))
     (+ (string-to-number (car timelist))
        (/ (string-to-number (cadr timelist))
           60.0))))


HTH

  reply	other threads:[~2007-06-14 19:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-14 12:38 How to get hours from hh:mm Cecil Westerhof
2007-06-14 13:35 ` Pascal Bourguignon
2007-06-14 13:57   ` Cecil Westerhof
2007-06-14 18:27     ` Pascal Bourguignon
2007-06-14 19:06       ` Alexis Roda [this message]
     [not found]       ` <mailman.2173.1181847997.32220.help-gnu-emacs@gnu.org>
2007-06-16 15:10         ` Cecil Westerhof
2007-06-16 15:32           ` Cecil Westerhof
2007-06-16 15:41           ` Joost Kremers
2007-06-16 15:52           ` David Kastrup
2007-06-16 17:28             ` Cecil Westerhof
2007-06-16 16:16           ` Stephen Berman
2007-06-14 20:15     ` J. David Boyd
     [not found]     ` <mailman.2178.1181852166.32220.help-gnu-emacs@gnu.org>
2007-06-15  5:52       ` Pascal Bourguignon
2007-06-15  6:06         ` cmr.Pent

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.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=467191B7.8010001@gmail.com \
    --to=alexis.roda.villalonga@gmail.com \
    --cc=help-gnu-emacs@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.
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).