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 uASFLKAllmKmVAAAbAwnHQ (envelope-from ) for ; Tue, 31 May 2022 16:26:40 +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 AF90LKAllmKvBAAA9RJhRA (envelope-from ) for ; Tue, 31 May 2022 16:26:40 +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 3738B307D9 for ; Tue, 31 May 2022 16:26:40 +0200 (CEST) Received: from localhost ([::1]:56708 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nw2pS-0007O0-R3 for larch@yhetil.org; Tue, 31 May 2022 10:26:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48708) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nw2li-0005Ax-Vz for emacs-orgmode@gnu.org; Tue, 31 May 2022 10:22:47 -0400 Received: from mail-io1-xd33.google.com ([2607:f8b0:4864:20::d33]:45811) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nw2lh-0003Fy-9F for emacs-orgmode@gnu.org; Tue, 31 May 2022 10:22:46 -0400 Received: by mail-io1-xd33.google.com with SMTP id d198so14225796iof.12 for ; Tue, 31 May 2022 07:22:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ddoherty.net; s=google; h=references:user-agent:from:to:cc:subject:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=Jzt3ZGFa36Y3zHDXIaBnNc1bxaAfPdu6TXxC5kPSiyw=; b=AvOtihqmDrYRZRbCHpX8FZ6j99tyi+ndYALme1zEfDVQ987gKLbVYhwrSTukhaxCjN NPYZWRchwjnzD/ue4b2Bs8hD2qbM5WAhrByMMhMVArr0G45g8iyVM+48mHqpj0dQepbL OWeILilr+/D5JJjPfTKH1QOjYOTz+Od9R8dSs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:references:user-agent:from:to:cc:subject:date :in-reply-to:message-id:mime-version:content-transfer-encoding; bh=Jzt3ZGFa36Y3zHDXIaBnNc1bxaAfPdu6TXxC5kPSiyw=; b=Mb7O0Rp+2FTJstvrvIlljT3x6Z8oryFDOhm2kwOGoptEutpQ8pt6RR4GsnQmOaNXP0 mF9P4WtH7NBH/49qsGfz/98HCs3Cm/pFnB2hluCuZzSNRZoSar1DMConLDu3qOh8b7bP NsgTT4G6UavlBkWacGxcXIEnouDDdMwXkvXLgk58dbhmB09Fp223osDxu3EuwnJAdMBU cPirteyKf3z7TOixva6hnumazDf1ikLExJgrRjeOjYMz4FDyZX8cV+bP5l7acia/X7d0 EV8JvwVLXKldcgNHZIsYRTwD1/PAqynSzlfh72Nr6BKZc8Cr1o3FOymzGYjxkZHV7ICt /OSg== X-Gm-Message-State: AOAM532OWSvSs7BzPsyvc2VMz4jqs4pM5hquql9Zjc+EUbpbG65t5JST CAyV11S1pCIIh6tXJqi046VLA45c5ngSmQ== X-Google-Smtp-Source: ABdhPJwJKvrj3CzvgiQEsxZH/ChJBL8AGRHSQdMWufsoGECNgRTDDdWfcmkGOfNcxVqojXru+GSmsg== X-Received: by 2002:a6b:da05:0:b0:65e:5027:89f8 with SMTP id x5-20020a6bda05000000b0065e502789f8mr24642471iob.217.1654006962637; Tue, 31 May 2022 07:22:42 -0700 (PDT) Received: from saturn.ddoherty.net ([136.33.241.2]) by smtp.gmail.com with ESMTPSA id i14-20020a056e020d8e00b002d1620ccf85sm4642013ilj.81.2022.05.31.07.22.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 May 2022 07:22:42 -0700 (PDT) References: <87pmk0qdfb.fsf@ddoherty.net> <87a6b3gza9.fsf@localhost> <87y1ynul7o.fsf@ddoherty.net> <87ee0f58tl.fsf@localhost> User-agent: mu4e 1.6.2; emacs 29.0.50 From: "Daniel E. Doherty" To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Subject: Re: Allow Currency Symbols and Grouping Commas in Table Numbers Date: Tue, 31 May 2022 09:19:24 -0500 In-reply-to: <87ee0f58tl.fsf@localhost> X-Keywords: Org-Mode Message-ID: <87ee09dbnz.fsf@ddoherty.net> 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::d33; envelope-from=ded@ddoherty.net; helo=mail-io1-xd33.google.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, 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=1654007200; 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=Jzt3ZGFa36Y3zHDXIaBnNc1bxaAfPdu6TXxC5kPSiyw=; b=bRtZ3DoUxPCsS0DZckeMsaSqHpWeIfTZiDcqF8L0Lp6rP9MHGFkyBWM4jjAWVdDQuUuwKQ 7EW7tQd3V1e5O4Ie0awOVxLi4HXHWYrNBclfxtg1KDSL8qSlSGp0FgpPff/B/WPVmONMdr w98oxIC4UVA5BNSSJiBHvx2EOud8qdpbdHQN5fIUE0JvftsmKmNRi64bJqHMtMgYPA7aY4 usMejmll43fwXWA9e1vwYP58iN7b8pJSERzLE2OyMDU3SUHLrUyRGYNQg3c3izVfNbamUf zC6rgliIwbkRxqrCAKmZi+qxHvXXLdPvCEcVnXQUzOempTF9R8L+PTDZWcO8Mg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1654007200; a=rsa-sha256; cv=none; b=K7ikmW9lTlJMskAwQG64fcGsNNcFAzEimYMOCcoZUKGY52U/N8JwuXdYrt7DMSDozV+QCf eJh5ts95s4vdDCtjfu4fpp6MknCjkXuirEc3hSWq0snBuipNpEuN6QGj8a2e4AsFM1OKFw VOlYZbKvhHOud6JR17I3B+UUYCLBzrst5abfMmfun+e2bMY7co2U9rkq6j5CA5XMoM+lnE Kt95NRrEEY8zCfUFswQ/bzv/AOGFW0r/Mpni1XOTWWg7ey+5Oj1eKOaQos2TBGebQhlwRm hUyIWCd+SsyzOD7RbGbqXYHeF1vaAPzTnbkjArPLCQDdO43pzFyx0ddHOCe5UA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=ddoherty.net header.s=google header.b=AvOtihqm; dmarc=none; 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=ddoherty.net header.s=google header.b=AvOtihqm; dmarc=none; 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: 3738B307D9 X-Spam-Score: -3.54 X-Migadu-Scanner: scn1.migadu.com X-TUID: Wo7ta7w/oURw Ihor, Again, thanks for your thoughts. All, however, ruin the look of the tables. Could you, perhaps, point me to where in the vast org code, strings are converted to numbers in preparation for sending to calc? I could then play with overriding the function and come up with a work-around. Regards, On Fri, May 27 2022, Ihor Radchenko wrote: > "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 = commands.) One > exception is the =E2=80=98\,=E2=80=99 separator, which doesn=E2=80=99t in= terfere 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 lat= ex 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 > > | 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 -- =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Daniel E. Doherty Law Offices of Daniel E. Doherty 7300 W. 110th Street, Suite 930 Overland Park, KS 66210 913.338.7182 (Phone) 913.338.7164 (FAX) ded@ddoherty.net