From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id MBj6Df6NgF86SQAA0tVLHw (envelope-from ) for ; Fri, 09 Oct 2020 16:21:18 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id +Ae1Cf6NgF/DUgAAB5/wlQ (envelope-from ) for ; Fri, 09 Oct 2020 16:21:18 +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 9845C9402B1 for ; Fri, 9 Oct 2020 16:21:17 +0000 (UTC) Received: from localhost ([::1]:39856 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kQv8u-0008MB-F9 for larch@yhetil.org; Fri, 09 Oct 2020 12:21:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33546) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQv2D-0001hs-Rr for emacs-orgmode@gnu.org; Fri, 09 Oct 2020 12:14:22 -0400 Received: from grinta.net ([109.74.203.128]:34440) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kQv29-0002j6-Fg for emacs-orgmode@gnu.org; Fri, 09 Oct 2020 12:14:21 -0400 Received: from black.local (unknown [37.120.217.83]) (Authenticated sender: daniele) by grinta.net (Postfix) with ESMTPSA id C5105EAC77 for ; Fri, 9 Oct 2020 16:14:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=grinta.net; s=2020; t=1602260049; bh=qcIo/Lp/KKFsdxam19ifK+LN1tL7pC/VUT73eCqx6JA=; h=Subject:To:References:From:Date:In-Reply-To:From; b=M92+h7x1ds6JZD0evvHv8QFfwFnboAfENupD4US40zPuRhQEaVtrmQnCLiNGimOYK qqZWOIbJwlLVeLfBZBngzvaNuScUqdCulZZyUyoW0hmaITvEVMq4Sd4Iqtqr/qlWcV ldrA4V/y581c+pLQHqkJfsH8dT5PQXIeGGe8DIosOS9o33ViCJ8e4Wx9aGU3fDMkEG J5YleU2aB4axm1+d0XvS4U935MNDBRBoQGKNaIB4Uo1gsJkWoWea2BOGKkMd7qd6BX ufrKxY7gTYXLWkFahcm7RN+b0uHMdKOOEiahRdyOPBhMj1NLkSTMbKwf/sRRA9Y5zQ gfrlUxPYth4Mw== Subject: Re: org-tables with monetary amounts To: emacs-orgmode@gnu.org References: <3444a52f-36a7-6e9d-46b9-272dddc7a3ef@grinta.net> <87wo0jttxz.fsf@christianmoe.com> From: Daniele Nicolodi Message-ID: Date: Fri, 9 Oct 2020 18:14:08 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <87wo0jttxz.fsf@christianmoe.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=109.74.203.128; envelope-from=daniele@grinta.net; helo=grinta.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/09 12:14:10 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 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, LOTS_OF_MONEY=0.001, NICE_REPLY_A=-0.208, SPF_HELO_PASS=-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-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=grinta.net header.s=2020 header.b=M92+h7x1; dmarc=none; 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-Spam-Score: -0.01 X-TUID: OdmIPNIRjIVK Hello Christian, thank you for your input. calc support for units indeed covers the basics of working with currencies. I gave it a spin on some notes I have been working on recently. While some things work very nicely, other are a bit ugly. It is a good start and I'll explore this approach more. On 24/09/2020 11:17, Christian Moe wrote: > Now, with the Calc command to simplify units, you can add dollars to > euros and get the result in whichever currency comes first in the > algebraic expression > > | 3 USD | 4 EUR | 6.58 EUR | > #+tblfm: $3=usimplify($2+$1) > > | 3 USD | 4 EUR | 7.6511628 USD | > #+tblfm: $3=usimplify($1+$2) Having to explicitly use usimplify() is a bit too verbose. It would be ideal if this could be somehow be implicit. > I don't use this functionality, so I don't have answers to all the > questions you'll now have -- including how to get the desired precision > without lopping off the currency unit in the last example! Having the desired fixed precision is quite important for this to be useful. In y recent tests I had to drop the units (currencies) to achieve this. It would be nice to find a way to avoid it. > There are ways to enter user-defined units permanently. But exchange > rates change, so to use this functionality on a daily basis, you'll want > to have some kind of function to pull exchange rates and update the > currency unit definitions in the Calc init file. Computations usually refer to a specific point in time, thus this is npt a big problem in practice. I already have scripts to pull exchange rates at a given date. These can the be inserted as a property that can be easily references from the computations. > Apart from `usimplify', most Calc functions on units appear (?) to be > missing corresponding algebraic versions that you can use in Calc > expressions in Org tables, which limits the usefulness. > > Org tables don't seem to have any specific formula syntax for leveraging > Calc unit operations apart from what happens to work out of the > box. This might be an area for improvement, though I'm not sure what to > ask for. I don't understand what you mean in the two paragraphs above. Can you please clarify, maybe with examples? Thank you. Cheers, Dan