From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Brand Subject: Re: tables: is it possible to use a comma instead of a period as a number delimiter Date: Mon, 16 May 2011 12:05:31 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:34044) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QLugD-000127-BI for emacs-orgmode@gnu.org; Mon, 16 May 2011 06:05:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QLug9-0003ah-3Z for emacs-orgmode@gnu.org; Mon, 16 May 2011 06:05:37 -0400 Received: from mail-ew0-f41.google.com ([209.85.215.41]:51748) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QLug8-0003Uc-VK for emacs-orgmode@gnu.org; Mon, 16 May 2011 06:05:33 -0400 Received: by ewy9 with SMTP id 9so1420902ewy.0 for ; Mon, 16 May 2011 03:05:31 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Izzie Cc: emacs-orgmode@gnu.org Hi Izzie The only direct solution I can think of now is with Emacs Lisp for number/string conversion and ./, replacement: #+begin_src emacs-lisp :results silent (defun com2num (com) "convert number string with comma like \"2,3\" to number like 2.3" (string-to-number (replace-regexp-in-string "," "." com))) (defun num2com (fmt num) "convert number like 2.300001 to number string with comma like \"2,3\", formatted with fmt like \"%.1f\"" (replace-regexp-in-string "\\." "," (format fmt num))) #+end_src | | |------| | 10,2 | | 3,0 | | 5,6 | |------| | 18,8 | #+TBLFM: @5='(num2com "%.1f" (apply '+ (mapcar 'com2num '(@2..@4)))) Michael On Mon, May 16, 2011 at 01:12, Izzie wrote: > I started using org tables including a column of numbers formatted the European > way with a comma instead of a period, for example 127,43 for 127.43. > > When I use a formula to sum the whole column it expect a period and ends up with > a false calculation. I'd revert my numbers to the American format but this table > is used for accounting so it's not an option. Going through the manual didn't > provide any help. > > Is there a way to have org use the european format or am I to ditch the formula > and make use of C-c + to manually calculate the sum ?