From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Problem with lisp code in spreadsheet Date: Sun, 17 Jun 2007 00:14:29 +0200 Message-ID: <7e4a77e5b8fa3274e12ce0d4c4d53f0a@science.uva.nl> References: <1182016207.6246.127.camel@Barebusta.DecebalComp> Mime-Version: 1.0 (Apple Message framework v624) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HzgXS-000864-JD for emacs-orgmode@gnu.org; Sat, 16 Jun 2007 18:14:34 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HzgXQ-00085s-Vu for emacs-orgmode@gnu.org; Sat, 16 Jun 2007 18:14:33 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HzgXQ-00085p-RJ for emacs-orgmode@gnu.org; Sat, 16 Jun 2007 18:14:32 -0400 Received: from korteweg.uva.nl ([146.50.98.70]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HzgXQ-0003ww-HY for emacs-orgmode@gnu.org; Sat, 16 Jun 2007 18:14:32 -0400 In-Reply-To: <1182016207.6246.127.camel@Barebusta.DecebalComp> 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: Cecil Westerhof Cc: org-mode 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