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

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

Re: number-to-string-pad


From: Yuri Khan
Subject: Re: number-to-string-pad
Date: Sat, 27 Jan 2018 15:27:45 +0700

On Sat, Jan 27, 2018 at 2:06 PM, Emanuel Berg <address@hidden> wrote:
> Did anyone do
>
> (defun number-to-string-pad (number len)

(format "%04d" number)

If you don’t know the length beforehand, you could do:

(format (format "%%0%dd" len) number)



reply via email to

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