From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.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 QP+BB2MD2GKcDAAAbAwnHQ (envelope-from ) for ; Wed, 20 Jul 2022 15:30:11 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id IBCNBmMD2GIDUAAAG6o9tA (envelope-from ) for ; Wed, 20 Jul 2022 15:30:11 +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 CBA2D41123 for ; Wed, 20 Jul 2022 15:30:10 +0200 (CEST) Received: from localhost ([::1]:40294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oE9mD-0007QP-0P for larch@yhetil.org; Wed, 20 Jul 2022 09:30:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34018) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oE9ad-0003Tu-Ig for emacs-orgmode@gnu.org; Wed, 20 Jul 2022 09:18:12 -0400 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]:38767) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oE9ac-0007nd-4n for emacs-orgmode@gnu.org; Wed, 20 Jul 2022 09:18:11 -0400 Received: by mail-pl1-x62c.google.com with SMTP id w7so2481488plp.5 for ; Wed, 20 Jul 2022 06:18:09 -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; bh=fy9jeOdfPCASIt51k2vVXRi7iwV9KWJQV7P6+9gWQzk=; b=faeYHxVu9c7Ymozcmig0MJF7IjylGw5N+yrrJ/9inustPhtRqaVGR8gS3q/lkvefEJ glqR6LMWp24qsyFqTqHGgEyoYJWrQj0F8rT9lbprL369XaeZdp5iL2A0kNkz0WsCdCTh VcTES7wBiXBYFlIaOjbzExLbRxWBiVUXvnRVt7uMFl1Suh6uwL88FIJyzCqH2HJbjqQu E3+aTPzl7owkQUHnA2Wr46CiLjMcWEllWg7Z0GvdLiH7Y0lNu3EG5aRLEa88GCoAlNQp 7Uf7+1rzIXJE9pKl5A2LjaphSlUGWXtEzYt+7rD/NYn7ja7ieNY5FOFsVTR/Nc7vn71C QglQ== 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; bh=fy9jeOdfPCASIt51k2vVXRi7iwV9KWJQV7P6+9gWQzk=; b=cOh1Dz1h9rx01dtfqPdNft1QpQh38S0rRHYHftujN4w9JkunN+GRCBNUjI8/5qPG+Q J5bK5e5W7c5OcTBQ8+5U831SQS4wIrQi3/5y4eeZLKQfo2VBvjN5UW8rAKIG+H+kg9O2 49Ad+eGmjvEImXScwvLudA+oK81gOGBKtrZCnqpy/13q54rO7ClJKkx1p6aN7Zqz9fgK uLavYTh2K5gBcdQOS5NNa1ypTdAg9d4zLhFro2TdHjXLekq3RwXu6XoAhMpp6oC+gX1B CNZMjyID6tlk9UOV72fcffG0HXrM9mYpPO3M15yeXwMjDkmGPnxTdzN6mC6Bfi5PRkWF S8Uw== X-Gm-Message-State: AJIora8t81uLngqOIiAWm+melvRhEJDIXVEQnMptNUcUL/gqJDrG3QFB 3t+vxuObIcpakcO4yfvAU5s= X-Google-Smtp-Source: AGRyM1vi1MVLENn5QEiZ13EcLOpNR7pv+FNVwCqp+2K04v9W2FE6O7NLvt24jOHBWKabF0V6Cloddw== X-Received: by 2002:a17:902:e54b:b0:16c:38e5:a9b7 with SMTP id n11-20020a170902e54b00b0016c38e5a9b7mr38691337plf.66.1658323088763; Wed, 20 Jul 2022 06:18:08 -0700 (PDT) Received: from localhost ([2409:8a70:2b7:3fb0:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id l20-20020a17090af8d400b001f202eac037sm1584883pjd.34.2022.07.20.06.18.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 06:18:08 -0700 (PDT) From: Ihor Radchenko To: Uwe Brauer Cc: emacs-orgmode@gnu.org Subject: Re: [feature] Allow "," decimal point in table cells In-Reply-To: <87edyg499x.fsf@mat.ucm.es> References: <87zgh6gb78.fsf@mat.ucm.es> <87y1wp44bk.fsf@localhost> <87fsix6uaq.fsf@mat.ucm.es> <87fsiw4gke.fsf@localhost> <87edyg499x.fsf@mat.ucm.es> Date: Wed, 20 Jul 2022 21:19:11 +0800 Message-ID: <87k0873os0.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=yantar92@gmail.com; helo=mail-pl1-x62c.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=1658323810; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=fy9jeOdfPCASIt51k2vVXRi7iwV9KWJQV7P6+9gWQzk=; b=Dd2XmVCsUF4nl8JEa+/9ynoPw2M+aU1Mp2ujgZCq71jicymmyyTC01qHhwd1q4rviXYOc5 t2OQn2ShJWsVGH3nEnAcsiEyhqXEaA1hWbLDnDHzQcAyAXuE4hLM3bbOv47RtTxogDeAg4 7nRCVOkNHh0apwM6FDx1unQ2lhIO8WcdHJirUHmcGIbw6/HjN44b3CEXQz3bCohtMVxVnC +wdEsC0tSg18d0TQ/IkEqJiT2nwIbh+NZGFmyIwtiOBksHvPwp04aAd0zFb1Wk1ibx0/+a sFCENTrKHyGXy802o0Q3MVCuN0OtdzHJoKE6Ps3D8pGOvyqRjVXdA7uUhbBTJg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1658323810; a=rsa-sha256; cv=none; b=YSOuR1Q8WzwKG6vWt4+MeRcaMQhKHqeswttvaE117yaO40KEclsPzPMphtgk87gCV7srfX tRMPcme4gazEDZwZaRTw2RjojDl4ow0jac0b9tS/ejifLaBq12bm81D/pcns2g4E2CYw41 uJsWWaUQc2kv25B/KA0FiINhnSXJrgj1JjdJgewCjgjaeU1y3lGoabxe7Q/rGcroRJ2Gby PJOHtX80VDqZuaLrsj9dj2IP2mtFyklPneu7qvCkE6J3mxkMNFc8atrf2V7JlM3tw7xJPX b+e5PcHfk5mtEqqG2Rhdb4OUjP7Yqs3a93PNr9n+iiwy9RHwuJD3lriApg+Hzw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=faeYHxVu; 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: -7.43 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=faeYHxVu; 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: CBA2D41123 X-Spam-Score: -7.43 X-Migadu-Scanner: scn0.migadu.com X-TUID: K2PfS8OAc5wq Uwe Brauer writes: >> Note that you can instead use Elisp formulas. See 3.5.3 Emacs Lisp forms >> as formulas. It is more flexible. > > Can you give me an example? #+begin_src emacs-lisp (defun yant/convert-cd (x) "Replace \",\" in X string with \".\" and return number." (string-to-number (replace-regexp-in-string "," "." x))) (defun yant/convert-dc (x) "Replace \".\" in X number with \",\" and return string." (replace-regexp-in-string "\\." "," (format "%s" x))) #+end_src | 3,5 | 4,2 | 7,7 | #+TBLFM: $3='(yant/convert-dc (apply '+ (mapcar #'yant/convert-cd (list $1 $2)))) Yes, it is awkward. Yet possible. >> Alternatively, we may implement the comma separators as a built-in >> feature. Org table formulas already support notations like > >> | 3,5 | 4,2 | 7 | > >> #+TBLFM: $3=$1+$2;N > > Not sure I understand this > > | 3,5 | 4,2 | 7 | (7, 7) | (7, 7) | > | | | | | | > #+TBLFM: $3=$1+$2;N::$4=$1+$2;E::$5=$1+$2;L ;N means "convert to number using string-to-number". (string-to-number "3,5") ;; => 3 why? read the docstring (it ignores non-recognized trailing chars ",5") L makes no sense in calc formulas (it has no effect). E refers to dealing with empty field and has no effect here. Best, Ihor