From unknown Sun Jun 22 17:09:54 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#7829 <7829@debbugs.gnu.org> To: bug#7829 <7829@debbugs.gnu.org> Subject: Status: locale-related printf bug when using formats with thousands grouping character Reply-To: bug#7829 <7829@debbugs.gnu.org> Date: Mon, 23 Jun 2025 00:09:54 +0000 retitle 7829 locale-related printf bug when using formats with thousands gr= ouping character reassign 7829 coreutils submitter 7829 Eric Blake severity 7829 normal tag 7829 fixed thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 12 08:50:58 2011 Received: (at submit) by debbugs.gnu.org; 12 Jan 2011 13:50:58 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pd16I-0005GJ-Fb for submit@debbugs.gnu.org; Wed, 12 Jan 2011 08:50:58 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pd16F-0005G6-45 for submit@debbugs.gnu.org; Wed, 12 Jan 2011 08:50:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pd1DU-0001CJ-AF for submit@debbugs.gnu.org; Wed, 12 Jan 2011 08:58:25 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:36461) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pd1DU-0001CE-82 for submit@debbugs.gnu.org; Wed, 12 Jan 2011 08:58:24 -0500 Received: from [140.186.70.92] (port=48435 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pd1DT-0006kf-3f for bug-coreutils@gnu.org; Wed, 12 Jan 2011 08:58:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pd1DR-0001B5-Kr for bug-coreutils@gnu.org; Wed, 12 Jan 2011 08:58:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:64382) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pd1DR-0001Ag-C4 for bug-coreutils@gnu.org; Wed, 12 Jan 2011 08:58:21 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p0CDwKqA027827 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 12 Jan 2011 08:58:20 -0500 Received: from [10.3.113.124] (ovpn-113-124.phx2.redhat.com [10.3.113.124]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p0CDwJoR030064 for ; Wed, 12 Jan 2011 08:58:19 -0500 Message-ID: <4D2DB37B.5010701@redhat.com> Date: Wed, 12 Jan 2011 06:58:19 -0700 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7 MIME-Version: 1.0 To: bug-coreutils Subject: Re: locale-related printf bug when using formats with thousands grouping character References: <20110112033126.GA29319@ti93.telemetry-investments.com> <20110112034017.GA2216@ti93.telemetry-investments.com> <4D2DB234.5050003@redhat.com> In-Reply-To: <4D2DB234.5050003@redhat.com> X-Enigmail-Version: 1.1.2 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig11BAB9696AB72E4E8480C088" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Spam-Score: -7.9 (-------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -7.9 (-------) This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig11BAB9696AB72E4E8480C088 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable [redirecting to bug-coreutils] On 01/12/2011 06:52 AM, Eric Blake wrote: >> bash-4.1$ printf "%'.2f\n" 999999.9998071828 >> ,000,000.00 >> > It appears that glibc fails to account for the fact that rounding may > increase the number of result characters by 2 instead of 1 when %' is i= n > effect (going from 999 to 1,000, at any power of 10*3). >=20 > Please file a glibc bug, and in the meantime, gnulib should consider > modifying the printf-posix family of modules to work around this > rounding bug. Ouch - coreutils' printf is also affected: $ /usr/bin/printf %\'.2f\\n 999.9998 999999.9998 1000000 1000.00 ,000,000.00 1,000,000.00 At least printf(1) already uses the xprintf-posix module, so hopefully this gets fixed once gnulib works around the glibc bug. --=20 Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org --------------enig11BAB9696AB72E4E8480C088 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJNLbN7AAoJEKeha0olJ0Nq37oIAIC40pox3wgYoB/g4kTNsr93 QdD1JrCG7KVq9yLEtXs3eT+lMz/uS7rXpci0cbSHWz7WzGpZDw6RqNzsPYPsbwvR dlo9DvOTLf5JnEaByf3PPi4gcXk55RkQ5r5I0FLwpsh6hDU29Gxyb9fZHuJ0C+gu L99q2OOdBzwZ8p0TlwIM1lKoagoECmw/MRU6XGMhJS1ncdhV9gP1OMc7pqi78B0o Feu+7ToHcSzudQSqHteWL6Hw6geA9oBdfu9zBe53HAbnsCTclo8vJeKVwwL6mMaG unoSIdVqmLwwA+ybQ9AsOzqHQw80eZRJXENJqfDmXGMYqnZqLzSfgHgo2Amp4/E= =kqOL -----END PGP SIGNATURE----- --------------enig11BAB9696AB72E4E8480C088-- From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 18 21:51:36 2018 Received: (at 7829) by debbugs.gnu.org; 19 Oct 2018 01:51:36 +0000 Received: from localhost ([127.0.0.1]:57962 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gDJwu-0005YX-2X for submit@debbugs.gnu.org; Thu, 18 Oct 2018 21:51:36 -0400 Received: from mail-pl1-f169.google.com ([209.85.214.169]:32880) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gDJwr-0005YA-NQ; Thu, 18 Oct 2018 21:51:34 -0400 Received: by mail-pl1-f169.google.com with SMTP id s4-v6so15150653plp.0; Thu, 18 Oct 2018 18:51:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=KentNE4wpTFetAVAEyn1d6RndKgdo1fAdoJBZiLgQig=; b=diICb7V4U96ultGZWXzVrNa8lMRylX/fr9Yco+08eZl8RCZlKPWOB+zzaE6k2ntOc4 THmLqd12WiVhC/iQPYvqMXM0WfhinHk4TCsARfk5r+aMkDW19ZyEsmWXlKp6TefLIq7w FkezuCOixc3xsJpH5xBXUxQNCZ2L3W8r/Sm+VypGkGKqed8Ba8i6dzKTaxaPtpnanoc8 tD8RcjHpbMTzsZ3DfN1u6xk8TlJIjn5mhrBPuoWZwcmA+lhZ8vssWZMXPIeD4Kis+04I JiiioATh51feGukKi6Q7L0hSVuaYsCqOI0iCHLQ1RLcR0K8hNO0s1FjMKJYv4EYbmvqo rA5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=KentNE4wpTFetAVAEyn1d6RndKgdo1fAdoJBZiLgQig=; b=fv2nOhlDKjXFTFC+owqE1WiP7flaR+EXNOfF7bfyDWXlBFVlnu4SGOXXPC+XBRSlJY cAPRIPITRWBq4EvwhpZkjZz5vI0iVF8JU6tgFZ5cjoUB+dbI9Qza19UkwoiRHqxytAdF ZRV+CLk4w2oJ7jiXDt2ZvN6OAv42TUYUTRy7PG1qF2toA8V1cBRVbtt6W+FWgHgu/4We Iz9HdI3j/RevW5f2f82nM3QP9jqJNMR90Wqq9oWT9Vs/TlalJrieCMk5WMbE4frFKPsj wk2yDqhM21MUW48bXXctRS3yX5kl/LdGjbIk7nU9FioZNJzu+KbriLs+eEfLiBmSH3I9 aDIw== X-Gm-Message-State: ABuFfoi8+7+qWsskr+M8USBR3KKxQHAhfOTN9KyBAO96w++uzXCkji9T nMTZud9fN8C5yBMgxwzAySxUDmYVv4Y= X-Google-Smtp-Source: ACcGV62qgn+tQbO/L9fGF7ug4NDzJ5pl/s8/ckTDoANZUWU01+dhSXUvNLCUNudcctjWN+yjl7dOFQ== X-Received: by 2002:a17:902:2:: with SMTP id 2-v6mr32791994pla.178.1539913886822; Thu, 18 Oct 2018 18:51:26 -0700 (PDT) Received: from tomato.housegordon.com (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id e2-v6sm23078346pgv.25.2018.10.18.18.51.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Oct 2018 18:51:25 -0700 (PDT) Subject: Re: bug#7829: locale-related printf bug when using formats with thousands grouping character To: 7829@debbugs.gnu.org References: <20110112033126.GA29319@ti93.telemetry-investments.com> <20110112034017.GA2216@ti93.telemetry-investments.com> <4D2DB234.5050003@redhat.com> <4D2DB37B.5010701@redhat.com> From: Assaf Gordon Message-ID: <5a718385-26fb-3226-08e0-f4030013a7ee@gmail.com> Date: Thu, 18 Oct 2018 19:51:24 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <4D2DB37B.5010701@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 7829 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 7829 fixed close 7829 stop (triaging old bugs) On 12/01/11 06:58 AM, Eric Blake wrote: > Ouch - coreutils' printf is also affected: > > $ /usr/bin/printf %\'.2f\\n 999.9998 999999.9998 1000000 > 1000.00 > ,000,000.00 > 1,000,000.00 > > At least printf(1) already uses the xprintf-posix module, so hopefully > this gets fixed once gnulib works around the glibc bug. I just verified this works fine with recent coreutils version, so closing. -assaf From unknown Sun Jun 22 17:09:54 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 16 Nov 2018 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator