From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Leha Subject: 2 questions on tables Date: Mon, 15 Jul 2013 08:47:12 +0200 Message-ID: <871u705ngv.fsf@med.uni-goettingen.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58113) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UycZJ-0003h7-3f for emacs-orgmode@gnu.org; Mon, 15 Jul 2013 02:47:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UycZH-00025N-VI for emacs-orgmode@gnu.org; Mon, 15 Jul 2013 02:47:33 -0400 Received: from plane.gmane.org ([80.91.229.3]:50925) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UycZH-000258-Oz for emacs-orgmode@gnu.org; Mon, 15 Jul 2013 02:47:31 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UycZG-0000GD-Px for emacs-orgmode@gnu.org; Mon, 15 Jul 2013 08:47:30 +0200 Received: from genepi110.genepi.med.uni-goettingen.de ([134.76.140.110]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 15 Jul 2013 08:47:30 +0200 Received: from andreas.leha by genepi110.genepi.med.uni-goettingen.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 15 Jul 2013 08:47:30 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi all, I have two questions concerning tables in orgmode: 1. What is the best way to handle missing values? I have the problem, that missing values ("") are treated as "0" when they appear in a formula. Entering ("nil") instead helps a bit, but does not propagate, i.e. nil + 1 results in 0. Can I do better? 2. What is the best way to drop a column while preserving the number of digits displayed? I use a simple code block to drop the columns. But I do not see how to prevent orgmode from dropping trailing 0s Here is an example demonstrating both questions: --8<---------------cut here---------------start------------->8--- #+TITLE: Drop columns * Create Some Table with a Missing Value #+name: mytable | Item | Price ($) | Price ($+1) | |-----------+-----------+-------------| | Apple | 10.55 | 11.55 | | Tomato II | nil | 0.00 | | Tomato | | 1.00 | | Pear | 3.00 | 4.00 | | Monkey | 100.55 | 101.55 | |-----------+-----------+-------------| | Sum | 10.55 | 118.10 | #+TBLFM: $3=$2+1;%.2f::@7$2=vsum(@I..@II);%.2f::@7$3=vsum(@I..@II);%.2f * Drop a Column #+name: mysmalltable #+begin_src emacs-lisp :var input=mytable[,0:1] :exports results input #+end_src #+results: mysmalltable | Item | Price ($) | |--------+-----------| | Apple | 10.55 | | Tomato | | | Pear | 3.0 | | Monkey | 100.55 | --8<---------------cut here---------------end--------------->8--- Regards, Andreas