emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Org table: numeric locale


From: Maxim Nikulin
Subject: Re: Org table: numeric locale
Date: Sat, 28 Aug 2021 17:19:04 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

On 28/08/2021 14:07, Jarmo Hurri wrote:

I wonder if it is possible to get org table formulas to respect numeric
locale.

Even to add some functions to Emacs that respect numeric locales, it is necessary to use e.g. dynamic modules (warning: do not try to change global locale by setlocale(3), almost certainly something in Emacs will be broken, a library that allows local locale objects is strongly preferred).
https://www.gnu.org/software/emacs/manual/html_node/elisp/Writing-Dynamic-Modules.html

Emacs documentation says that Emacs uses the value of LC_NUMERIC:

https://www.gnu.org/software/emacs/manual/html_node/emacs/General-Variables.html

It is a confusing statement, see:
- https://debbugs.gnu.org/cgi/bugreport.cgi?bug=29645
  #29645 Feature Request: Locale aware formatting
  Date: Sun, 10 Dec 2017 15:05:02 UTC
- https://lists.gnu.org/archive/html/emacs-devel/2021-06/msg00327.html
  https://lists.gnu.org/archive/html/emacs-devel/2021-06/msg00139.html

The state of numeric locales in Emacs is a little worse than just unsupported. Mostly "C" is forced for LC_NUMERIC, so e.g. grouping is not used. However if your locale uses comma "," as decimal separator,
you may be confused by calc results:

    M-x calc RET dg RET 123456
    123,456




reply via email to

[Prev in Thread] Current Thread [Next in Thread]