emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Maxim Nikulin <manikulin@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Org table: numeric locale
Date: Sat, 28 Aug 2021 17:19:04 +0700	[thread overview]
Message-ID: <sgd2ip$13ht$1@ciao.gmane.io> (raw)
In-Reply-To: <8735qut5co.fsf@iki.fi>

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	other threads:[~2021-08-28 10:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-28  7:07 Org table: numeric locale Jarmo Hurri
2021-08-28 10:19 ` Maxim Nikulin [this message]
2021-09-05 11:08   ` Jarmo Hurri
2021-09-07 14:47     ` Max Nikulin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='sgd2ip$13ht$1@ciao.gmane.io' \
    --to=manikulin@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).