From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: rounding when exporting Date: Mon, 25 Jun 2018 19:19:52 -0400 Message-ID: <87bmby8ndz.fsf@alphaville.usersys.redhat.com> References: <87fu1ak48p.fsf@mat.ucm.es> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36065) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXamF-0005c8-K4 for emacs-orgmode@gnu.org; Mon, 25 Jun 2018 19:20:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXamA-0003eb-OX for emacs-orgmode@gnu.org; Mon, 25 Jun 2018 19:20:07 -0400 Received: from [195.159.176.226] (port=47640 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXamA-0003cy-Ho for emacs-orgmode@gnu.org; Mon, 25 Jun 2018 19:20:02 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1fXak0-0005Mp-Kv for emacs-orgmode@gnu.org; Tue, 26 Jun 2018 01:17:48 +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" To: emacs-orgmode@gnu.org Uwe Brauer writes: > Hi > > Is there way, that when I export and org file with a table, its content > is rounded when exported to html/latex? > The exporters take the text to be exported from the buffer, so if the buffer contains arbitrary precision, then I don't think so: you'd have to apply a filter of some sort. It's easy enough however to set the format for calc, recalculate all the tables, export, then reset the format and recalculate once more to get back to where you were. Note that internally org calculates floating point numbers to 12 decimal places (roughly) but displays only 8 of them (to keep the display a bit more compact). See (info "(org) Formula Syntax for Calc") for details. Here's an example to use fixed-point format with 3 decimals: --8<---------------cut here---------------start------------->8--- * Set floating point format to fixed point with 3 decimals :noexport: #+begin_src emacs-lisp (setq org-calc-default-modes '(calc-internal-prec 12 calc-float-format (fix 3) ;;; the default here was (float 8) calc-angle-mode deg calc-prefer-frac nil calc-symbolic-mode nil calc-date-format (YYYY "-" MM "-" DD " " Www (" " hh ":" mm)) calc-display-working-message t)) #+end_src * Table | x | log(x) | |----+--------| | 1 | 0 | | 2 | 0.693 | | 3 | 1.099 | | 4 | 1.386 | | 5 | 1.609 | | 6 | 1.792 | | 7 | 1.946 | | 8 | 2.079 | | 9 | 2.197 | | 10 | 2.303 | #+TBLFM: $2 = log($1) --8<---------------cut here---------------end--------------->8--- -- Nick "There are only two hard problems in computer science: cache invalidation, naming things, and off-by-one errors." -Martin Fowler