all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Clément Pit--Claudel" <clement.pitclaudel@live.com>
Cc: 25557@debbugs.gnu.org
Subject: bug#25557: Documentation of format doesn't describe "g" accurately
Date: Sat, 28 Jan 2017 21:31:52 +0200	[thread overview]
Message-ID: <83tw8jx9p3.fsf@gnu.org> (raw)
In-Reply-To: <5b3f43e8-195d-777c-e660-302a3baf5f61@live.com> (message from Clément Pit--Claudel on Sat, 28 Jan 2017 14:14:03 -0500)

> Cc: 25557@debbugs.gnu.org
> From: Clément Pit--Claudel <clement.pitclaudel@live.com>
> Date: Sat, 28 Jan 2017 14:14:03 -0500
> 
> >> I'm trying to get the shortest representation of a decimal number, rounded to .01, not using scientific/exponential notation.  I'm using values computed in ELisp to produce CSS style sheets, which until recently didn't allow for exponential notation.  I'd like these stylesheets to be readable, so 100% is better 100.00%, and 3.35em is better than 3.35004em. If my code is fed a value of 5000px, I don't want it converted to 5e+3px, because many browsers don't know how to parse that.
> > 
> > Then I think you want to use %d for integral values and %.2f for the
> > rest.
> 
> No, that still won't do: it wouldn't format 3.0 as "3", if I understand correctly.

??? (format "%d" 3.0) => "3"

Or maybe you didn't think 3.0 was an "integral value" by my
definition?  I meant by that any value VAL which yields zero when
passed through (mod VAL 1.0).





  reply	other threads:[~2017-01-28 19:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-27 22:05 bug#25557: Documentation of format doesn't describe "g" accurately Clément Pit--Claudel
2017-01-28  8:37 ` Eli Zaretskii
2017-01-28 15:04   ` Clément Pit--Claudel
2017-01-28 15:23     ` Eli Zaretskii
2017-01-28 15:45       ` Clément Pit--Claudel
2017-01-28 16:01         ` Eli Zaretskii
2017-01-28 16:18           ` Clément Pit--Claudel
2017-01-28 16:25             ` Eli Zaretskii
2017-01-28 19:14               ` Clément Pit--Claudel
2017-01-28 19:31                 ` Eli Zaretskii [this message]
2017-01-28 20:06                   ` Clément Pit--Claudel
2017-01-28 20:29                     ` Eli Zaretskii
2017-01-28 20:45                       ` Clément Pit--Claudel

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=83tw8jx9p3.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=25557@debbugs.gnu.org \
    --cc=clement.pitclaudel@live.com \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.