Subject: bug#71572: [PATCH] seconds-to-string-approximate

From: john muhl <[email-masked]>
Date: Sat, 07 Dec 2024 13:17:57 -0600

JD Smith <[email-masked]> writes:

>> On Dec 7, 2024, at 8:02 AM, Eli Zaretskii <[email-masked]> wrote:
>> 
>>> From: JD Smith <[email-masked]>
>>> Date: Sat, 30 Nov 2024 13:58:52 -0500
>>> Cc: Eli Zaretskii <[email-masked]>,
>>> Adam Porter <[email-masked]>,
>>> [email-masked],
>>> Paul Eggert <[email-masked]>
>>> 
>>> I was recently reminded of the need for a more capable seconds-to-string.  
>>> 
>>> Anyone have any additional comments on this proposed patch? If not,
>>> I'd suggest someone with access
>>> merges.
>> 
>> A few minor nits below, and then we can install:
>
> Thanks.  Updated patch below.

Thanks for working on this. I gave a quick try and noticed some
amounts aren’t pluralized how I expect; e.g.

  (seconds-to-string 36541462 'expanded nil 1)
  ;; "1 year 1.9 month"

  (seconds-to-string 73082924 'expanded nil 2)
  ;; "2 year 3.79 months"

  (seconds-to-string 2511822 'expanded nil 3)
  ;; "4 week 1.072 day"

I would expect those to output:

  1 year 1.9 months
  2 years 3.79 months
  4 weeks 1.072 days

According to the Chicago Manual of Style all fractional values are
plural, even 1.0, 2.0 &c.

The incorrect “2 year”, “4 week” only happen when PRECISION is
non-nil; e.g.

  (seconds-to-string 2511822 'expanded nil)
  "4 weeks 1 day"

p.s. There is a missing “is” in the last sentence of the docstring
for seconds-to-string.