GNU bug report logs - #25557
Documentation of format doesn't describe "g" accurately

Previous Next

Package: emacs;

Reported by: Clément Pit--Claudel <clement.pitclaudel <at> live.com>

Date: Fri, 27 Jan 2017 22:06:01 UTC

Severity: minor

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #43 received at 25557 <at> debbugs.gnu.org (full text, mbox):

From: Clément Pit--Claudel <clement.pitclaudel <at> live.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 25557 <at> debbugs.gnu.org
Subject: Re: bug#25557: Documentation of format doesn't describe "g" accurately
Date: Sat, 28 Jan 2017 15:45:57 -0500
[Message part 1 (text/plain, inline)]
On 2017-01-28 15:29, Eli Zaretskii wrote:
>> Cc: 25557 <at> debbugs.gnu.org
>> From: Clément Pit--Claudel <clement.pitclaudel <at> live.com>
>> Date: Sat, 28 Jan 2017 15:06:22 -0500
>>
>>> ??? (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).
>>
>> Yup, I misunderstood your definition of integral value.  But that still doesn't cover formatting e.g. 3.3 as "3.3" instead of "3.30", right?
> 
> Yes, but that cannot be a problem, since you said the browsers
> supported 2 digits after the decimal.

Indeed.  It's just a readability issue.

> Or you could get fancier by using %.1f for values for which
> 
>   (zerop (mod (* 10 VAL) 1.0))
> 
> is non-nil.

Sounds good.  Thanks!

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 8 years and 171 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.