emacs-devel
[Top][All Lists]
Advanced

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

LC_NUMERIC formatting [FEATURE REQUEST]


From: Boruch Baum
Subject: LC_NUMERIC formatting [FEATURE REQUEST]
Date: Wed, 2 Jun 2021 14:54:41 -0400
User-agent: NeoMutt/20180716

Please consider having the elisp 'format' function adopt the
single-quote and 'I' flags. Each is already implemented in both the GNU
C printf command and the linux printf command. The single-quote flag is
part of the 'Single UNIX Specification' and the 'I' flag has been part
of glibc since version 2.2 [ref: man(3) printf].

If function 'format' uses 'printf' as its backend, this would seem to be
a matter of exposing an existing feature.

The single-quote flag applies a locale's thousands' grouping characters
if appropriate, which I only find currently implemented as user-defined
functions, ie. outside of emacs-core.

   $ printf "%'d\n" 1234
   1,234

The 'I' flag [from man(3) printf]:

   uses the locale's alternative output digits, if any. For example,
   since glibc 2.2.3 this will give Arabic-Indic digits in the Persian
   ("fa_IR") locale.

   $ LC_ALL=fa_IR.utf8 /usr/bin/printf "%Id\n" 1234
   ۱۲۳۴
   $ LC_ALL=fa_IR.utf8 /usr/bin/printf "%'Id\n" 1234
   ۱٬۲۳۴

--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0



reply via email to

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