help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get hours from hh:mm


From: Stephen Berman
Subject: Re: How to get hours from hh:mm
Date: Sat, 16 Jun 2007 18:16:49 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

On Sat, 16 Jun 2007 17:10:48 +0200 Cecil Westerhof <dummy@dummy.nl> wrote:

> Alexis Roda wrote:
>> 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))))
>
> I tried this:
>
> (defun getMinutes(time)
>   (interactive "sDuration: ")
>   (let ((timelist (split-string time ":")))
>     (+ 
>       (string-to-number (car timelist))
>       (/ 
>         (string-to-number (cadr timelist))
>         60.0
>       )
>     )
>   )
> )
>
> When I dan give M-x getMinutes and on the prompt give: 00:18, I get:
>         Symbol's function definition is void: let

Somehow your version contains nobreak space characters starting right
after `let'.  If you change all of those to normal space characters,
the function works fine.

Steve Berman





reply via email to

[Prev in Thread] Current Thread [Next in Thread]