zsh-users
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: printf shortcomings
Date: Tue, 27 Sep 2011 09:51:26 +0200	[thread overview]
Message-ID: <24018.1317109886@thecus.kiddle.eu> (raw)
In-Reply-To: <CAELbujqnxAxzcqAvgaqDWd9yVeM+r0M4ir+EJmvHPu1qLgkoew@mail.gmail.com>

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


      reply	other threads:[~2011-09-27  7:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-27  7:09 Micah Elliott
2011-09-27  7:51 ` Oliver Kiddle [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=24018.1317109886@thecus.kiddle.eu \
    --to=okiddle@yahoo.co.uk \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).