help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: elisp to put commas a number?


From: Herbert Euler
Subject: RE: elisp to put commas a number?
Date: Fri, 13 Jun 2008 20:29:45 +0800

How about this one?

(defun commify (n)
  (let ((list '()))
    (while (> n 0)
      (setq list (cons (format "%d" (% n 1000)) list)
            n (/ n 1000)))
    (mapconcat (lambda (s) s) list ",")))

Regards,
Guanpeng Xu
_________________________________________________________________
Connect to the next generation of MSN MessengerĀ 
http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline



reply via email to

[Prev in Thread] Current Thread [Next in Thread]