From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id +FJwCBvlkGK2vAAAbAwnHQ (envelope-from ) for ; Fri, 27 May 2022 16:50:03 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id qCprCBvlkGLlDQEA9RJhRA (envelope-from ) for ; Fri, 27 May 2022 16:50:03 +0200 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 AB28632719 for ; Fri, 27 May 2022 16:50:02 +0200 (CEST) Received: from localhost ([::1]:45788 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nubHt-0006Fj-A1 for larch@yhetil.org; Fri, 27 May 2022 10:50:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52786) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nubHG-0006FL-W4 for emacs-orgmode@gnu.org; Fri, 27 May 2022 10:49:23 -0400 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]:33680) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nubHF-0002Pg-9r for emacs-orgmode@gnu.org; Fri, 27 May 2022 10:49:22 -0400 Received: by mail-pj1-x1035.google.com with SMTP id qe5-20020a17090b4f8500b001e26126abccso2585979pjb.0 for ; Fri, 27 May 2022 07:49:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=5vGqrm3g67Z0vMODjiSEEyFV554YliP363PjRrLAKH0=; b=EAmM8pRpjJPvYdpL/9T6Q4h+6MCKHVjFML+VeUIPz9byxqk+yS7Tv0A6+v1WUxENHk iLU69194LvFGr2BLh812lDRXFx9VirBiCu7T+Z6v40rC6P0VDi5IxyrzpN/fZQ/5kKyC VFKDfXmmJB/vBHb1Gc58h5NwLBqu99FBPQcFpa6GMjcVC1A/PaV0AzGkypoU/IGTZrW2 5IwPd5IZSUG7IZ82aNLo7GwRozG9CF3GTd22CYVE+kW61FvC+tVbu0V1ZdoxnACQkX2E wSeWcCkALRhH8WEcMc8npvkEgf5X8dOq+GAFzRYUOlBggZKZpt4qfgj1CRLMTc2peSGr 7rDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=5vGqrm3g67Z0vMODjiSEEyFV554YliP363PjRrLAKH0=; b=vR+lixzH9zKPU9PhmXZZgZPu19uZHXC8u+vu6od/A0RrRaLyvvFo91QUihg4Mrx5d7 LjTrrTcSXVreNPtPuty/bmDaBzd4eG86fmzr6lEoiyXAo+vFk9vPxPdcGFsmZ9qVFISu pEv5eWhHkDTtdRtO5Y1oAQPmJjACXUeMa++kyzZB569kbsnSAaDzsy7YW64Yw35I3LlD vRxoywGBXG4m5IWcvqzrVHGxpE69nCSdDQxp41OPTW9Y6ybosrzBafCyQ1mHKN90VNU4 zaA6AER0gyN0SIw54ne/jyF0Dg5qacnw0GS3aVyvzti0vqp12ojwaxUQZo277zzCweZk XFdQ== X-Gm-Message-State: AOAM531cBhju1lN4UgD1qZmjY2RBnmLqqZlBdQg30HsX9/V+a2rrEtvD az10V3pGNpE6WzxuGJgY/h2cojD3q2DdaqtfOWg= X-Google-Smtp-Source: ABdhPJxRl0HmsOOt6QUpvnY2kRRgB//heb5iPVpNiJ6FnLmVedutDgNB5y6juAVgWQb30fPYU/pW5Q== X-Received: by 2002:a17:90a:930b:b0:1d5:684b:8e13 with SMTP id p11-20020a17090a930b00b001d5684b8e13mr8814844pjo.153.1653662960029; Fri, 27 May 2022 07:49:20 -0700 (PDT) Received: from localhost ([64.32.23.62]) by smtp.gmail.com with ESMTPSA id o1-20020a17090ac08100b001d25dfb9d39sm1715518pjs.14.2022.05.27.07.49.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 May 2022 07:49:19 -0700 (PDT) From: Ihor Radchenko To: "Daniel E. Doherty" Cc: emacs-orgmode@gnu.org Subject: Re: Allow Currency Symbols and Grouping Commas in Table Numbers In-Reply-To: <87y1ynul7o.fsf@ddoherty.net> References: <87pmk0qdfb.fsf@ddoherty.net> <87a6b3gza9.fsf@localhost> <87y1ynul7o.fsf@ddoherty.net> Date: Fri, 27 May 2022 22:49:58 +0800 Message-ID: <87ee0f58tl.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=yantar92@gmail.com; helo=mail-pj1-x1035.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 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 X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1653663002; 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=5vGqrm3g67Z0vMODjiSEEyFV554YliP363PjRrLAKH0=; b=sNe8+wejfw4PQC7a8AvSv5OVP3NlJlyWB+p5WtsT2w7WE33bsOowyDA5pJkmIUD1l+IsSV obCcjKXd9gp2lTxITtmK8QhOGyVxhEms6hu8ks5A8ReOF4VrAYQskwfKBXxnQBQ+Ukq/Ym 5Qm+uJfm7SN9M18i6ASlNtrFbL9h5dluQePRnf+gK65S+LFgZae5JtjTcUBFV/2CNSVhgS AFOoTxEmiFtEHYWZRIK4a+JmwOP8hQ0RQ7F7qwOrFkkvM3A2D+be4W0JQxTUzNM+5KPhEg w+5MNQb2q6ckuRAMxok8V0hP4KHjH1Nx09TmDRmiaAgky0Cml9mxFvW2vKjZaA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653663002; a=rsa-sha256; cv=none; b=jlNMfhElHVmtPd4nQ4MPI0uOR892NsfVTfsRmrh6fpKLqusGhT69/Y5+3qnWEug3g/dCWx lvH9748RvgOfs8nOSiXWi+2iYrw5rFnYxPJMHFOdv7AyCRkDDFK5Wd3Y/l5pE+Eck4w581 EiMOziflBAws0aqXZUO8qmSO9ftK62zxyHusNwf63sXdOerEvqq3q6UdSaieeVHPxN/1gd qLjan0Q3xMEbO1onLmyWT9AKdyf/w6t5OOoWfVyuYday4xj0NxBqPZmxIitMv8O0dFoJ2I 0+HYY0L+YJ9MrgyP8kxRIcR5l35P94h7OwAgLpMlpM8+vczJ5/6nyBDZgmMWpA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=EAmM8pRp; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.54 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=EAmM8pRp; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: AB28632719 X-Spam-Score: -3.54 X-Migadu-Scanner: scn1.migadu.com X-TUID: GS8XjX3CDNfE "Daniel E. Doherty" writes: > | Description | Amount | > |--------------+------------| > | Mortage | 125,000.26 | > | Credit Cards | 6,325.00 | > | Auto Loan | 14,853.00 | > |--------------+------------| > | Total | 1323.26 | > #+TBLFM: @5$2=3Dvsum(@I..@II) > > Note that the total is wrong. Well. This is also a caveat from calc, unfortunately. 7.7.2 Grouping Digits Please note that grouped numbers will not generally be parsed correctly if re-read in textual form, say by the use of =E2=80=98C-x * y=E2= =80=99 and =E2=80=98C-x * g=E2=80=99. (*Note Kill and Yank::, for details on these co= mmands.) One exception is the =E2=80=98\,=E2=80=99 separator, which doesn=E2=80=99t inte= rfere with parsing because it is ignored by TeX language mode. So, you can instead do | Description | Amount | |--------------+-------------| | Mortage | 125\,000.26 | | Credit Cards | 6\,325.00 | | Auto Loan | 14\,853.00 | |--------------+-------------| | Total | 146178.26 | #+TBLFM: @5$2=3Dvsum(@I..@II) Or with #+begin_SRC emacs-lisp (setq org-calc-default-modes '( calc-internal-prec 12 calc-float-format (float 8) calc-angle-mode deg calc-prefer-frac nil calc-symbolic-mode nil calc-language latex ;; <--- this is new compared to default, enable latex= symbols calc-group-digits t ;; <--- group digits in the results calc-group-char "\\," calc-date-format (YYYY "-" MM "-" DD " " Www (" " hh ":" mm)) calc-display-working-message t)) #+end_SRC | Description | Amount | |--------------+-------------| | Mortage | 125\,000.26 | | Credit Cards | 6\,325.00 | | Auto Loan | 14\,853.00 | |--------------+-------------| | Total | 146\,178.26 | #+TBLFM: @5$2=3Dvsum(@I..@II) > | Description | Amount | > |--------------+----------------------------| > | Mortage | \dollar 125000.26 | > | Credit Cards | 6325.00 | > | Auto Loan | 14853.00 | > |--------------+----------------------------| > | Total | 125000.26 \dollar + 21178. | > #+TBLFM: @5$2=3Dvsum(@I..@II) > > Total is still wrong. You need=20 | Description | Amount | |--------------+----------------------------| | Mortage | \dollar 125000.26 | | Credit Cards | \dollar 6325.00 | | Auto Loan | \dollar 14853.00 | |--------------+----------------------------| | Total | 146178.26 \dollar | #+TBLFM: @5$2=3Dvsum(@I..@II) Best, Ihor