From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Rounding in org-mode tables Date: Sun, 26 Aug 2007 20:25:21 +0200 Message-ID: References: Mime-Version: 1.0 (Apple Message framework v624) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IPMnd-0006Ud-QM for emacs-orgmode@gnu.org; Sun, 26 Aug 2007 14:25:25 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IPMnd-0006UP-Bh for emacs-orgmode@gnu.org; Sun, 26 Aug 2007 14:25:25 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IPMnd-0006UM-9I for emacs-orgmode@gnu.org; Sun, 26 Aug 2007 14:25:25 -0400 Received: from korteweg.uva.nl ([146.50.98.70]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IPMnc-0004Su-W4 for emacs-orgmode@gnu.org; Sun, 26 Aug 2007 14:25:25 -0400 In-Reply-To: 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: James Hawley Cc: emacs-orgmode@gnu.org On Aug 26, 2007, at 4:00, James Hawley wrote: > Hi! > > I'm a relatively new emacs and org-mode user so I apologize for the > basic nature of this question. Unfortunately, the answer is probably > so obvious that no one has had to ask it before, and, as a result, I > have not been able to find this subject in the mailing list. Of > course, I may not be doing a good search, so please accept another > apology. > > Anyway, all I am trying to do is to sum a column of numbers in a table > in an org file. Here's an example: > > 935.15 > 6483.80 > 7419.00 > #+TBLFM: @16$4=vsum(@3$4..@4$4);%.2f > > The answer is obviously being rounded but I don't want that and I > cannot figure out the undoubtedly trivial way to stop it so I get the > answer that I want to see - 7418.95. > > Thanks for any help anyone offers on this simple (but frustrating for > me) question. Org-mode uses a relatively compact output format for calc in order to avoid that fields get too wide. You can fix this by changing the default format in `org-calc-default-mode' from (float 5) to (float 8) or so, but that means each time a number is produced with many digits, all 8 will be displayed. The other option is to change the format on the fly, just for a specific formula, using (again for example) an f8 flag, like $4 = vsum($1..$3);f8 Hope this helps. - Carsten