From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16942 invoked by alias); 27 Sep 2011 07:57:20 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16438 Received: (qmail 4651 invoked from network); 27 Sep 2011 07:57:18 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at yahoo.co.uk does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s1024; t=1317109887; bh=rEHnMByqtDenOVfph79nHQwQCrHmvXHS3AHeDvEFB3U=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Received:In-reply-to:From:References:To:Subject:MIME-Version:Content-Type:Content-ID:Date:Message-ID; b=vZCfv9KHaJiARtPHv1yEgzxTHwZepAVNWbEGrDWfyKCiTJLLnxxGDlrAQf5TFwiOzo1Af1MaHZDORuu1yZg/iRZ4XGjuSQHcu3SDUaAM5156W547CIybfLj0R8jG0dlYdhM0aGylZBNHIJWxni3gfj5RxQcclT5D+XDvKPqXEYI= X-Yahoo-Newman-Id: 175363.27294.bm@smtp139.mail.ukl.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: iWvbzdEVM1m9.WonmZ1_33r9HmHfAacE1Q0dHTgF24tSoeL YKeOCl.M6eWBWijcgXtJbadFOUPLADnnTTlqMBoOwze.ZkgXueyv2y.dqJao 2D_ieZeKsUo5uhtXsYEUsncZic_pcG4DwIJKMqAJEgHv4lIQB1QUPLhsAKiJ bpoItslPiEbDogsB2_4GUaqnOArFeMstGL_yRGJYK_tZhWLBq6ErKMz26iM. Hzl9ksV_FPF0o9IopnWi6MluFUR6zI6JQCV4Q94..sya6rRcwAMsBegjP42q GbaDPyi5wKf_fduMYYLTsYkXiaW_lrPshTU5N.kA03od8AxqDjMmnKFRrO4U vokoYlWwWgHoxI9NwjpoorcMSD7JaSzwMF1RaT2VzJzWDznqLZq2YshYL3aE _eJjwt4k_XiJHpge9futzijt09ZOJTYQXxhRnuS.0uoIImbBfeKrx4RIGFh6 j52ZtPC.Knw9nmZMH8g.zz_pK4oeVPKGtVQ-- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- In-reply-to: From: Oliver Kiddle References: To: Zsh Users Subject: Re: printf shortcomings MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <24010.1317109881.1@thecus.kiddle.eu> Date: Tue, 27 Sep 2011 09:51:26 +0200 Message-ID: <24018.1317109886@thecus.kiddle.eu> Micah Elliott wrote: > I was looking at `printf(3)` and also this lovely reference > (http://www.pixelbeat.org/programming/gcc/format_specs.html) and > noticed that the "locale thousands grouping" flag (') doesn't appear > to be supported by Zsh's builtin printf. I don't have an important > need for this today, but noticing that it could be pretty useful. That is a reference for the GNU libc printf. The thousand grouping flag is by no means standard. Zsh's printf largely uses the system printf underneath, so it isn't completely trivial to support GNU specific flags portably (keep in mind that lots of flags can be combined so it isn't just a case of sticking a character in before every third digit). We could pass through the ' so that it only works where supported by the system printf but we'd need to be sure it doesn't have any nasty side effects on some system. If you do zmodload zsh/langinfo, you can get the thousand separator from $langinfo[THOUSEP] so if you ever do need the feature, it may be possible to implement it using that. Oliver