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

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

Re: blank cells in ses range


From: Jonathan Yavner
Subject: Re: blank cells in ses range
Date: Mon, 29 Nov 2004 12:05:05 -0500

> how to specify a printer function which will insert a comma separator.

(defun format-with-commas (x)
  (setq x (number-to-string x))
  (while (string-match "\\([0-9]\\)\\([0-9][0-9][0-9]\\)\\([,.]\\|\\'\\)" x)
    (setq x (replace-match "\\1,\\2\\3" t nil x)))
  x)

It would be nicer if one could just say (format "%'d" x), but that's a can
of worms since the \' operator doesn't do anything in the POSIX locale.


reply via email to

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