Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15146 > unrolled thread

Re: built-in printf %f parameter format depend on LC_NUMERIC

Started byDennis Clarke <dclarke@blastwave.org>
First post2019-07-12 15:55 -0400
Last post2019-07-12 15:55 -0400
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: built-in printf %f parameter format depend on LC_NUMERIC Dennis Clarke <dclarke@blastwave.org> - 2019-07-12 15:55 -0400

#15146 — Re: built-in printf %f parameter format depend on LC_NUMERIC

FromDennis Clarke <dclarke@blastwave.org>
Date2019-07-12 15:55 -0400
SubjectRe: built-in printf %f parameter format depend on LC_NUMERIC
Message-ID<mailman.1054.1562961325.2688.bug-bash@gnu.org>
On 7/12/19 3:50 PM, Chet Ramey wrote:
> On 7/12/19 3:46 PM, Dennis Clarke wrote:
> 
>> uh huh ...
>>
>>           LC_NUMERIC
>>
>>               This category specifies the  decimal  and  thousands
>>               delimiters.  The  information  corresponding to this
>>               category is stored in a  database   created  by  the
>>               localedef()    command.   The   default   C   locale
>>               corresponds to "." as the decimal delimiter  and  no
>>               thousands  delimiter.  This  environment variable is
>>               used by localeconv(3C), printf(3C), and strtod(3C).
> 
> I assume this means that bc doesn't use strtod.
> 

I dunno ... I am surprised here. I thought *everything* in strict POSIX
and XPG4/XPG6 compliant systems were locale aware and neatly smart about
how to talk to the user.

Here is "C" or "POSIX" locale :
corv $
corv $ df -h
Filesystem             Size   Used  Available Capacity  Mounted on
jupiter_zones/z/001     95G    85G       9.8G    90%    /
/dev                    95G    85G       9.8G    90%    /dev
proc                     0K     0K         0K     0%    /proc
ctfs                     0K     0K         0K     0%    /system/contract
mnttab                   0K     0K         0K     0%    /etc/mnttab
objfs                    0K     0K         0K     0%    /system/object
swap                   8.0G    74M       7.9G     1%    /etc/svc/volatile
fd                       0K     0K         0K     0%    /dev/fd
swap                   8.0G    74M       7.9G     1%    /tmp
swap                   8.0G    74M       7.9G     1%    /var/run
corv $


Now Let's go to France !

corv $ LC_ALL=fr_FR.UTF-8 LC_NUMERIC=fr_FR.UTF-8 df -h
Système de fichiers  Taille Utilisé Disponible Capacité  Monté sur
jupiter_zones/z/001     95G    85G       9,8G    90%    /
/dev                    95G    85G       9,8G    90%    /dev
proc                     0K     0K         0K     0%    /proc
ctfs                     0K     0K         0K     0%    /system/contract
mnttab                   0K     0K         0K     0%    /etc/mnttab
objfs                    0K     0K         0K     0%    /system/object
swap                   8,0G    74M       7,9G     1%    /etc/svc/volatile
fd                       0K     0K         0K     0%    /dev/fd
swap                   8,0G    74M       7,9G     1%    /tmp
swap                   8,0G    74M       7,9G     1%    /var/run
corv $

Yep.  Perfect.

And then there is "bc" which seems to care less.  Yep, I just gotta look
at the sources.


-- 
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web