Path: csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: Dennis Clarke Newsgroups: gnu.bash.bug Subject: Re: built-in printf %f parameter format depend on LC_NUMERIC Date: Fri, 12 Jul 2019 15:55:17 -0400 Lines: 77 Approved: bug-bash@gnu.org Message-ID: References: <5d24be33.1c69fb81.59c43.fe4dSMTPIN_ADDED_BROKEN@mx.google.com> <6468b45e-5b4a-8edf-4ab8-0838843beaaf@noiraude.net> <7c757690-24bd-7b1a-cf8e-af63cbe05216@noiraude.net> <91ed1981-df04-aa06-b108-23c7f89de3b4@case.edu> <4dde13d8-dc42-52b5-bc15-e5390f6d7ec5@archlinux.org> <51bed6f0-eeb8-c93b-33e7-6ccaf4d73b3f@blastwave.org> <6368906c-62d5-eccb-458b-2cbb6156416a@blastwave.org> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: usenet.stanford.edu 1562961326 12751 209.51.188.17 (12 Jul 2019 19:55:26 GMT) X-Complaints-To: action@cs.stanford.edu To: chet.ramey@case.edu, bug-bash@gnu.org Envelope-to: bug-bash@gnu.org X-TCPREMOTEIP: 99.253.177.25 X-Authenticated-UID: dclarke@blastwave.org User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.0 In-Reply-To: Content-Language: en-US X-MIME-Autoconverted: from 8bit to quoted-printable by atl4mhob12.registeredsite.com id x6CJtIrm022529 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.17.115.50 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <6368906c-62d5-eccb-458b-2cbb6156416a@blastwave.org> X-Mailman-Original-References: <5d24be33.1c69fb81.59c43.fe4dSMTPIN_ADDED_BROKEN@mx.google.com> <6468b45e-5b4a-8edf-4ab8-0838843beaaf@noiraude.net> <7c757690-24bd-7b1a-cf8e-af63cbe05216@noiraude.net> <91ed1981-df04-aa06-b108-23c7f89de3b4@case.edu> <4dde13d8-dc42-52b5-bc15-e5390f6d7ec5@archlinux.org> <51bed6f0-eeb8-c93b-33e7-6ccaf4d73b3f@blastwave.org> Xref: csiph.com gnu.bash.bug:15146 On 7/12/19 3:50 PM, Chet Ramey wrote: > On 7/12/19 3:46 PM, Dennis Clarke wrote: >=20 >> uh huh ... >> >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 LC_NUMERIC >> >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 This category specifies the=C2=A0 decimal=C2=A0 and=C2=A0 thousands >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 delimiters.=C2=A0 The=C2=A0 information=C2=A0 corresponding to this >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 category is stored in a=C2=A0 database=C2=A0=C2=A0 created=C2=A0 by=C2= =A0 the >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 localedef()=C2=A0=C2=A0=C2=A0 command.=C2=A0=C2=A0 The=C2=A0=C2=A0 de= fault=C2=A0=C2=A0 C=C2=A0=C2=A0 locale >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 corresponds to "." as the decimal delimiter=C2=A0 and=C2=A0 no >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 thousands=C2=A0 delimiter.=C2=A0 This=C2=A0 environment variable is >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 used by localeconv(3C), printf(3C), and strtod(3C). >=20 > I assume this means that bc doesn't use strtod. >=20 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=3Dfr_FR.UTF-8 LC_NUMERIC=3Dfr_FR.UTF-8 df -h Syst=C3=A8me de fichiers Taille Utilis=C3=A9 Disponible Capacit=C3=A9 M= ont=C3=A9 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. --=20 Dennis Clarke RISC-V/SPARC/PPC/ARM/CISC UNIX and Linux spoken GreyBeard and suspenders optional