From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id hqTWK8ieKGFGBQAAgWs5BA (envelope-from ) for ; Fri, 27 Aug 2021 10:14:00 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id ECu8JsieKGEhTwAAbx9fmQ (envelope-from ) for ; Fri, 27 Aug 2021 08:14:00 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E3A302F240 for ; Fri, 27 Aug 2021 10:13:59 +0200 (CEST) Received: from localhost ([::1]:37136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJWzu-0001e6-VD for larch@yhetil.org; Fri, 27 Aug 2021 04:13:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33604) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJWyj-0000oe-1z for emacs-orgmode@gnu.org; Fri, 27 Aug 2021 04:12:45 -0400 Received: from sonic309-24.consmr.mail.ir2.yahoo.com ([77.238.179.82]:36165) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJWyc-0000Q5-2x for emacs-orgmode@gnu.org; Fri, 27 Aug 2021 04:12:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1630051952; bh=GlHh73O6QXjiQ6TmO1N62tL9oAiuRU8d71Zxj7IXJgI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From:Subject:Reply-To; b=dX3LOkSGB3UY61LfBW54usKhSLzz4sNPIlcHS9QQn+nwhdb2xHF+A3JxCkRPNRVxIXKLJNnF8S7jXneFJmcLPfTucQbryv0YPYbGG3W+TYFTYfkiAf28EXzFqc/ROZTODMxqv5YqKbN28xkDNoKrsv/uYh0TzsoLXyS7AlsZNmGptIpjgoWCLLKXsTnf+Xbdx0FmQ3Ne2iVy9G64jow5CRx95ywwZFCRZe3FUGHJke4QkXjUm4mNCp8KCdEwCoFllH5++L61OH5FG11CgtDUQNpUpO6UYgT7AQ8myJPEDUStIqItt/+RrMSilphPy35N3TCU7nvLGQWxjKk8ov3jpw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1630051952; bh=OL2ibBe3rGXgqQEtc/kM3f7+32N9A5bDxkKwew7tJca=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=pKBc95nh1a/hG0d21QkEWgX97Hz9zRJCNsDc8hghoD7J8puDFDoFDGvs0SYcy6hSmVI09CO26pVel5i6onDZubPhk9u1MdgEWBNXceykEobl9WtTyLdZRkTi1nvepjc7LOJAsBb1rF5uFg+3137DgroV+10UL/5dg+fyF9jg4Y/olEr3u6Sy6wMcWM3tR44XMBwj+QuJuj+17wDPIV+mBgWtoVWLWKZwjTQ0Uy39RtiGSYy739ic7PQPb0fjzrpHbRglMjEeSaHaF/6/otSl/ep7OfuXA7ctpRBr05DrwqDhzpPimXlDmP12mvqGRv4zWLewV4llInNKAznGJtPe7Q== X-YMail-OSG: jvT0iZoVM1nlI4AkfyKwp11wMePVvk.mY.F7KG.KQ8M7D_0szWVaHXw.8UNcxoC lS3JsUyvsxRsgK5yKukgqAANgzo.x9L_vdbKDFgk96sZRBbUZkToQG1j4Ft5YJVWw0ogqg33Nldp zndCLHp5X2x.4HPMhZ1yckZQuXe0D_VHeujYhTaCIfFt3QJMf_dcWbWpgIjxPntBsW3Isbt3hHzv iH34RP4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hmmoGQakWwVCCz2 tIIm6cshrcYN3zxg2Udhez3RSeUmgnzODuLHBZzVBMeawesU- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.ir2.yahoo.com with HTTP; Fri, 27 Aug 2021 08:12:32 +0000 Received: by kubenode521.mail-prod1.omega.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID ef881b61ae6080c55a403318d105e3fb; Fri, 27 Aug 2021 08:12:30 +0000 (UTC) Date: Fri, 27 Aug 2021 08:12:26 +0000 From: Norwid Behrnd To: Jarmo Hurri Cc: emacs-orgmode@gnu.org Subject: Re: Org table: emphasizing calculated cell Message-ID: <20210827081226.402ce8c3@carnot2> In-Reply-To: <8735qvcyyy.fsf@iki.fi> References: <87r1egeozd.fsf@iki.fi> <20210826075152.17173b56@carnot2> <8735qvcyyy.fsf@iki.fi> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=77.238.179.82; envelope-from=nbehrnd@yahoo.com; helo=sonic309-24.consmr.mail.ir2.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1630052040; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=GlHh73O6QXjiQ6TmO1N62tL9oAiuRU8d71Zxj7IXJgI=; b=m0YkPYhKuczFe2lpm747l7fSixq2b6/+VXOHK8KbrTfhojIkBEeRZFvZBB/yGoka9MHfwv PGfUykaXikPpBmSsXnVc6l21993/CYyA0r8t2JMkSRCK7PX8BYTMbYg9scUb17QMYsMZxk 7MJvmJC/NUFCN6knHlSbEH0miuGiUei43s9M26PlFwF8fHFzE5ZWbIgt9yKMnTwQ5OCnGv syb30jZqQ2aXPHaBTtfoe/ju7cK2eMe4bc0a0zc1SGQE6tQGW7QLpR+s/g+/DDFZgiTxBT ci5dSheLBfkUZXRhNd8HY9U1xR123a73eCggLG3RLmgI7udKwRvDHqe+G5GmVg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1630052040; a=rsa-sha256; cv=none; b=ZawhNbhTpe4EHygw7r0Jg9VhgTgtslZw5k2N3gNqcNedlaGrCxSURHteS2bt4T+pzVCdRL PxS57czZG9xjKfWUTdlOosDMDJVN33oJNTBMGOBsaSj1AdLG76qdEFS+dMFbbbAsNRV9TH GZ5sXVCmaXA845o3HIbEB2t9NGtsD6S5QIZoJF8ZgqvNIA8U4LvI5A/cvIuc6GJ5pvzWj9 ef6cO/mwiL5RulQDwCx/BIm8UBhJWdho5pSJ6rLD1bMs3I0SsNPb3CSePkAVv41Zw+xKIk VoJOrkMnl8RNJ/o3+wmzA0j1YW2FrNnbRKiePCgqSr/lzlYlAX1ldHh8R2vqOA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=yahoo.com header.s=s2048 header.b=dX3LOkSG; dmarc=pass (policy=reject) header.from=yahoo.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.63 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=yahoo.com header.s=s2048 header.b=dX3LOkSG; dmarc=pass (policy=reject) header.from=yahoo.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: E3A302F240 X-Spam-Score: -2.63 X-Migadu-Scanner: scn0.migadu.com X-TUID: 4/eZVmzOvK1N Dear Jarmo, your observation is new to me because I only used the approach ``` #+TBLFM: @4$2=@-2/@-1; *%.2f* ``` at the end of a table e.g., about the grand total of an addition (there are other/better ways to achieve this). The instruction however computes the ratio, and formats twice the result; once for the number of decimals displayed (which is not the adjustable precision of computation), followed by the addition asterisks orgmode subsequently interprets to use bold glyphs. So eventually you concatenate characters, i.e. the content of the cell no longer is of type integer, nor a real/floating number. Since an addition in line of ``` A + 3.14 = ... ``` is not defined, Emacs reports an error. My insight in Emacs calc still is too small to know how to to trim character strings (i.e., remove of the asterisks) and convert a string of characters like ```3.14``` into a floating number. So there might be better solutions than the following. Let's use your idea to use /multiple table formulae/. Contrasting to your attempt, I don't mind to go the extra mile and to run a cheap computation twice for a result already in hand. As a MWE ``` | quantity | value | | A | 1 | | B | 3 | | ratio A/B | *0.33* | | ratio + 1 | 1.33 | #+TBLFM: @4$2 = @2/@3; *%.2f* :: @5$2 = @2/@3 + 1; %.2f ``` where the table is populated/updated by ```C-u C-c *```. -8><--- Side note: It is possible to experiment with multiple table formulae on multiple lines, e.g. to use here ``` #+TBLFM: @4$2 = @2/@3; *%.2f* #+TBLFM: @5$2 = @2/@3 + 1; %.2f ``` instead. This may be fine at the level to join the nuts and bolts, to populate (and update) the table TBLFM by TBLFM with an individual ```C-c C-c``` while the cursor is in the corresponding definition. The example below however suggests ```C-u C-c *``` considers only the first TBLFM and skips the other: ``` cave! incomplete update by C-u C-c * | quantity | value | | A | 20 | | B | 3 | | ratio A/B | *6.67* | | ratio + 1 | 1.33 | #+TBLFM: @4$2 = @2/@3; *%.2f* #+TBLFM: @5$2 = @2/@3 + 1; %.2f ``` Norwid