]> git.eshelyaron.com Git - emacs.git/commitdiff
; Fix last change
authorEli Zaretskii <eliz@gnu.org>
Sat, 21 Dec 2024 10:30:44 +0000 (12:30 +0200)
committerEshel Yaron <me@eshelyaron.com>
Mon, 23 Dec 2024 15:19:39 +0000 (16:19 +0100)
* doc/lispref/os.texi (Time Calculations): Extend documentation of
'seconds-to-string'; add missing @end defun.  (Bug#71572)

(cherry picked from commit b6852b67b0d462c7ba0012e5ac3b79a245f4b7e5)

doc/lispref/os.texi

index 14bdb3c56e2265f452c1c50d648e13938ed102ed..852f9f18204510d377e9735241b273bb7e044909 100644 (file)
@@ -2190,10 +2190,26 @@ structure.  For instance, the 120th day in 2004 is April 29th.
 @end defun
 
 @defun seconds-to-string delay &optional readable abbrev precision
-Return a string describing a given @var{delay} (in seconds).  Optional
-arguments can be used to configure a human readable delay using various
-formats.  For example, a delay of 9861.5 seconds with @var{readable} set
-to the symbol @code{expanded} returns @samp{2 hours 44 minutes}.
+Return a string describing a given @var{delay} (in seconds).  By
+default, this function formats the returned string as a floating-point
+number in units selected according to the value of @var{delay}.  For
+example, a delay of 9861.5 seconds yields @samp{2.74h}, since the value
+of @var{delay} is longer than 1 hour, but shorter than 1 day.  The
+output formatting can be further controlled by the optional arguments,
+if optional argument @var{readable} is non-@code{nil}.  If
+@var{readable}'s value is @code{expanded}, the returned string will
+describe @var{delay} using two units; for example, a delay of 9861.5
+seconds with @var{readable} set to the symbol @code{expanded} returns
+@samp{2 hours 44 minutes}, but if @var{readable} is @code{t}, the
+function returns @samp{3 hours}.  Optional argument @var{abbrev}, if
+non-@code{nil}, means to abbreviate the units: use @samp{h} instead of
+@samp{hours}, @samp{m} instead of @samp{minutes}, etc.  If
+@var{precision} is a whole integer number, the function rounds the value
+of the smallest unit it produces to that many digits after the decimal
+point; thus, 9861.5 with @var{precision} set to 3 yields @samp{2.739
+hours}.  If @var{precision} is a non-negative float smaller than 1, the
+function rounds to that value.
+@end defun
 
 @node Timers
 @section Timers for Delayed Execution