On Fri, 17 Oct 2025 15:37:14 -0400, Chet Ramey wrote:
> On 10/17/25 2:33 PM, Grisha Levit wrote:
> > > A zero precision just cuts the decimal point and everything following it.
> > > This is what ksh93 does, and consistent with what POSIX interp 267
> > > specified (the TIMEFORMAT part never actually made it into the standard).
> > 
> > I read that but didn't find anything that suggested a precision of 0 be
> > treated specially w.r.t. rounding. I think this is the relevant part of
> > the proposed text:
> > 
> >      The optional p is a decimal digit specifying
> >      the precision, the number of digits after the
> >      decimal point. A value of 0 shall not display
> >      the decimal point.
> 
> I interpreted a zero precision to mean you don't even look at the
> fractional part

The same way you could argue that a two precision to mean you don't even
look past the second digit after the decimal point.

No, I don't see why 0 should get a "special" treatment, different than the 
other precisions, when it could be easily rounded just the same way.



Reply via email to