From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id CKolKPYFkl+uMgAA0tVLHw (envelope-from ) for ; Thu, 22 Oct 2020 22:21:42 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id yHZ2IvYFkl+AbAAA1q6Kng (envelope-from ) for ; Thu, 22 Oct 2020 22:21:42 +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 C5E4E9400D3 for ; Thu, 22 Oct 2020 22:21:41 +0000 (UTC) Received: from localhost ([::1]:44722 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVixn-0003qi-61 for larch@yhetil.org; Thu, 22 Oct 2020 18:21:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43000) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kViwb-0003oX-R5 for emacs-orgmode@gnu.org; Thu, 22 Oct 2020 18:20:25 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:40165) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kViwa-0006RG-AZ for emacs-orgmode@gnu.org; Thu, 22 Oct 2020 18:20:25 -0400 Received: by mail-wm1-x32b.google.com with SMTP id k18so6100945wmj.5 for ; Thu, 22 Oct 2020 15:20:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=AjGZUZsuXDDgB24FGHqQ1XnTNbCfc6UEzevlmwO8FUk=; b=IFBv+zyXCjRbejFC8CIiCg1tcIjxWS27xlTj/IiHYk29XOmXnu2VIxJKEy1RgUQfS3 R/+qEsxhjzcGw0J4JygWFuOOsAFMyJh1QZ3D9nXHUlRkSA1rkYY9uVPaWGo7etDHncwC 2Qk14kc7LDaIgHZ3nqiJUJKxzb725L6lWw44RrhrT2GXle0cPLs1g1/ALQeDzBGXVlZW z+Ls3tynSsp5qGfasmmTqX6s5nKCACsRKTxEuJc1L5obxnCuYdZjJA1ovYNe+Me9qfEr 5CmhBBxQX7qCdAwSNBYzEKf76U9Rk2X2bqM6K9bPwLshRTTDl0rI3ls3VuELEJAGPKhy Bl5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=AjGZUZsuXDDgB24FGHqQ1XnTNbCfc6UEzevlmwO8FUk=; b=VfQvoefN9rojBGSJEJsYST3ob041j3utuM6PbXICEhnE0y1eeVaPva+8+NrEJFc+O2 634eb7RnfrYrf3SIg5DTgEbl+ps1lvNTWIX0MXOBjnkcM43attkCS+AzjCgjEfzB7oZC X89c5TSCvVqSrBTn6ga+idwCDt0z0iUppUxKUdCjTveVxlDjuodCzftRu3lZLsttKkpP G5W3glYA7pCzI28mx0E6la4JHa5nDbbuLWixXagPXCjIs2/NzJCznMJzlbaPCq7EfP8t IH2E1SoP1A0MmOIItNKiHviWlpscaouCa4j70+DQTy3R5q+w1gVCNF0ntM3x38/ns7Br VsHw== X-Gm-Message-State: AOAM531qE1FpsWUsKNAkahcwvMSk9npL+mJQ7duAYcNoLr1TnnnZWsBH gNOdEAmUovcfiixf+zWqbRdMwSILoIo= X-Google-Smtp-Source: ABdhPJwET84UGjJRH5rWovF8pPXTAokruOdGlmtwWPyHRvJiRTwUZVu96FIAC0lXL7edahlKvILjrg== X-Received: by 2002:a1c:f417:: with SMTP id z23mr4209078wma.57.1603405221985; Thu, 22 Oct 2020 15:20:21 -0700 (PDT) Received: from freegnu (24.183.22.109.rev.sfr.net. [109.22.183.24]) by smtp.gmail.com with ESMTPSA id s11sm5939050wrm.56.2020.10.22.15.20.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2020 15:20:21 -0700 (PDT) From: Jeremie Juste To: Mark Janes Subject: Re: org-table-sum References: <87pn6bc4z3.fsf@crane.swizzler.org> Date: Fri, 23 Oct 2020 00:20:19 +0200 In-Reply-To: <87pn6bc4z3.fsf@crane.swizzler.org> (Mark Janes's message of "Thu, 24 Sep 2020 13:08:48 -0700") Message-ID: <873625x5r0.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=jeremiejuste@gmail.com; helo=mail-wm1-x32b.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, 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: , Cc: Kein Test , emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=IFBv+zyX; dmarc=pass (policy=none) header.from=gmail.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-Spam-Score: -1.71 X-TUID: 4xqsGkREiL+X Hello I have figured out that calc-eval might do the job for the floating point problem for org. (info "(calc) Calling Calc from Your Programs") (calc-eval "83.6+0.1") So in the function org-table-sum I have made the following modification: > (res (string-to-number (calc-eval (combine-and-quote-strings (mapcar 'number-to-string numbers ) "+")))) modified lisp/org-table.el @@ -4771,7 +4771,7 @@ If NLAST is a number, only the NLAST fields will actually be summed." (nreverse items)))) (numbers (delq nil (mapcar #'org-table--number-for-summing items1))) - (res (apply '+ numbers)) + (res (string-to-number (calc-eval (combine-and-quote-strings (mapcar 'number-to-string numbers ) "+")))) (sres (if (= org-timecnt 0) (number-to-string res) (setq diff (* 3600 res) I believe that the org-table--number-for-summing function can be bypassed but my elisp foo is weak. Feel free to improve. Best regards Jeremie