From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: Re: getting calc-units working in table formulas Date: Wed, 17 Dec 2014 15:02:48 +0800 Message-ID: <87d27ioj1j.fsf@ericabrahamsen.net> References: <87oar4ql5t.fsf@ericabrahamsen.net> <87egrznl9e.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41369) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y18Xu-00058G-JX for emacs-orgmode@gnu.org; Wed, 17 Dec 2014 01:57:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y18Xp-0000GD-2P for emacs-orgmode@gnu.org; Wed, 17 Dec 2014 01:57:18 -0500 Received: from plane.gmane.org ([80.91.229.3]:43419) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y18Xo-0000G5-SQ for emacs-orgmode@gnu.org; Wed, 17 Dec 2014 01:57:13 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Y18Xi-0004TG-W4 for emacs-orgmode@gnu.org; Wed, 17 Dec 2014 07:57:07 +0100 Received: from 114.248.5.200 ([114.248.5.200]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 17 Dec 2014 07:57:06 +0100 Received: from eric by 114.248.5.200 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 17 Dec 2014 07:57:06 +0100 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 Michael Brand writes: > Hi Eric > > On Wed, Dec 17, 2014 at 2:09 AM, Eric Abrahamsen > wrote: >> Lastly, is there a way to both use output formatting, and retain the >> unit name (if desired)? Right now I get this: >> >> | km | units | conversion | >> |-------+-------+------------| >> | 2.5km | ft | 8202.10 | >> #+TBLFM: $3=uconvert($1, $2); %.2f >> >> Ie, the "ft" falls off the results when I add the "%.2f". Is it possible >> to retain that and have formatting? > > Yes, see > "org-spreadsheet: formatting chops off units" > http://thread.gmane.org/gmane.emacs.orgmode/59928 I'm certainly late to this party! My only excuse is that it's far from obvious, given the current manual, that all this is available (even after your documentation patch in the referenced thread). Just to note, the second of the two formatting solutions you mentioned (manually adding the units as a string) seems to no longer work. The first does, however. I'll work up a slightly longer documentation patch in the next couple of days -- I really think people should be alerted to what's possible with units. The "uconvert" defmath could even just be an example in the manual, rather than code that ships with Org. E