Function: elisp-refs--format-int

elisp-refs--format-int is a byte-compiled function defined in elisp-refs.el.

Signature

(elisp-refs--format-int INTEGER)

Documentation

Format INTEGER as a string, with , separating thousands.

Source Code

;; Defined in ~/.emacs.d/elpa/elisp-refs-20230920.201/elisp-refs.el
(defun elisp-refs--format-int (integer)
  "Format INTEGER as a string, with , separating thousands."
  (let ((number (abs integer))
        (parts nil))
    (while (> number 999)
      (push (format "%03d" (mod number 1000))
            parts)
      (setq number (/ number 1000)))
    (push (format "%d" number) parts)
    (concat
     (if (< integer 0) "-" "")
     (s-join "," parts))))