emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <dominik@science.uva.nl>
To: Cecil Westerhof <CecilWesterhof@xs4all.nl>
Cc: org-mode <emacs-orgmode@gnu.org>
Subject: Re: Problem with lisp code in spreadsheet
Date: Sun, 17 Jun 2007 00:14:29 +0200	[thread overview]
Message-ID: <7e4a77e5b8fa3274e12ce0d4c4d53f0a@science.uva.nl> (raw)
In-Reply-To: <1182016207.6246.127.camel@Barebusta.DecebalComp>


On Jun 16, 2007, at 19:50, Cecil Westerhof wrote:

> In a row I have the following formula's:
>   =$3
>   ='(getHours $2);%.2f
>   ='(/ 67 0.72);%.1f
>   ='(/ $3 (getHours $2));%.1f
> This gives:
>   67
>   0.72
>   93.1
>   0.0
>
> I would expect the last two to return the same number. Why is this not
> the case?
>
> When I change the last formula to:
>   ='(/ 67 (getHours $2));%.1f
> I get:
>   93.5
>
> What is happening here?

Since I don't know exactly what getHours does, I cannot be sure.
The most likely reason though is that $3 and $2 are interpolated into
Lisp expressions as strings, not as numbers.

See the discussion of the N mode flag in

http://staff.science.uva.nl/~dominik/Tools/org/org.html#Formula-syntax- 
for-Lisp

- Carsten

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

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-16 17:50 Problem with lisp code in spreadsheet Cecil Westerhof
2007-06-16 22:14 ` Carsten Dominik [this message]
2007-06-17  6:22   ` Cecil Westerhof
2007-06-17  9:56     ` Carsten Dominik

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=7e4a77e5b8fa3274e12ce0d4c4d53f0a@science.uva.nl \
    --to=dominik@science.uva.nl \
    --cc=CecilWesterhof@xs4all.nl \
    --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).