From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Herbert Euler Newsgroups: gmane.emacs.help Subject: RE: elisp to put commas a number? Date: Fri, 13 Jun 2008 20:29:45 +0800 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1213360233 6980 80.91.229.12 (13 Jun 2008 12:30:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 13 Jun 2008 12:30:33 +0000 (UTC) To: The Quiet Center , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jun 13 14:31:13 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K78Qx-0007OH-0y for geh-help-gnu-emacs@m.gmane.org; Fri, 13 Jun 2008 14:31:11 +0200 Original-Received: from localhost ([127.0.0.1]:37344 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K78Q9-0000w6-4b for geh-help-gnu-emacs@m.gmane.org; Fri, 13 Jun 2008 08:30:21 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K78Pe-0000u0-4T for help-gnu-emacs@gnu.org; Fri, 13 Jun 2008 08:29:50 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K78Pb-0000rJ-5F for help-gnu-emacs@gnu.org; Fri, 13 Jun 2008 08:29:49 -0400 Original-Received: from [199.232.76.173] (port=44762 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K78Pa-0000r9-R5 for help-gnu-emacs@gnu.org; Fri, 13 Jun 2008 08:29:46 -0400 Original-Received: from bay0-omc2-s38.bay0.hotmail.com ([65.54.246.174]:21186) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K78Pa-0006Jo-Rg for help-gnu-emacs@gnu.org; Fri, 13 Jun 2008 08:29:47 -0400 Original-Received: from BAY143-W28 ([65.55.154.63]) by bay0-omc2-s38.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 13 Jun 2008 05:29:46 -0700 X-Originating-IP: [222.130.200.243] Importance: Normal In-Reply-To: X-OriginalArrivalTime: 13 Jun 2008 12:29:46.0258 (UTC) FILETIME=[2A1BF720:01C8CD51] X-detected-kernel: by monty-python.gnu.org: Windows 2000 SP4, XP SP1+ X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:54789 Archived-At: 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=A0 http://imagine-msn.com/messenger/launch80/default.aspx?locale=3Den-us&sourc= e=3Dwlmailtagline=