From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: number-to-string-pad Date: Sat, 27 Jan 2018 15:27:45 +0700 Message-ID: References: <868tcjg4q6.fsf@zoho.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1517041612 18142 195.159.176.226 (27 Jan 2018 08:26:52 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 27 Jan 2018 08:26:52 +0000 (UTC) Cc: help-gnu-emacs To: Emanuel Berg Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jan 27 09:26:47 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1efLoo-0003bm-R0 for geh-help-gnu-emacs@m.gmane.org; Sat, 27 Jan 2018 09:26:34 +0100 Original-Received: from localhost ([::1]:34317 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1efLqo-0006o0-2q for geh-help-gnu-emacs@m.gmane.org; Sat, 27 Jan 2018 03:28:38 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33615) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1efLqK-0006nn-Dc for help-gnu-emacs@gnu.org; Sat, 27 Jan 2018 03:28:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1efLqJ-0006tf-Jj for help-gnu-emacs@gnu.org; Sat, 27 Jan 2018 03:28:08 -0500 Original-Received: from mail-ot0-x231.google.com ([2607:f8b0:4003:c0f::231]:37539) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1efLqJ-0006t5-DE for help-gnu-emacs@gnu.org; Sat, 27 Jan 2018 03:28:07 -0500 Original-Received: by mail-ot0-x231.google.com with SMTP id a24so2419207otd.4 for ; Sat, 27 Jan 2018 00:28:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=3cQzp3QvVWSuUqFDEKxbrM3zfbckgrxt5VlvVjNveyQ=; b=HWG7DJN8ryFCIV7LK50t4NjFTju2EFWlsyFTNXPCWQo5k0aTOsFJeZ9s6gOiJSKB+r hnuY94Ks6l5K37GkcG2kN8urWQVb16CGHcN30OyRIJNjfdxWQ/n3c6fQN6onO+tj1Nzo K9ZZ8vNgBfvcBq30x0kj4VsjYwo49KW50hMWYZF0iG0Ymqfj2XXZHiwmGvFveEzXnYL/ zgjG8qKn89sY2IhBXAvaSYVp6CVQt1ZywauY5swYP0zoX0TROzwVyF/Se1LOb7OgjOB9 KELv06JVfYQy2xlMVZn4FbUJc8OtoFeFih36c1uVMfaiVPnkw7cht0RVfrJKL/syy8pS S/2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=3cQzp3QvVWSuUqFDEKxbrM3zfbckgrxt5VlvVjNveyQ=; b=nywMYba7qCr7bgPMsbSpwmcwXPkpAXWvVedKWEOI+bqTL1SyZarG9h68AduXLaz4YH h1V6HM1UjyqX8X2ue7IU1lxM6lEPSzlsFivbWYyeIp/EURi1KQDGyzed0x+a0Cof211R LI3wHj0kdEIdo21PbFgFNU+v5WH497iesFyA8kw1K+1oE8DhmkDQehj2zcPOYcZNIA4+ QsSjLE9NKJQRPnEOuhWq0gvhxAcoIQJVhiSmE838BUAo87lbZa/C9T1f2VxaLOoJsVOQ /D+zct+e7Yd9OdtqvaEgvcjaMkE/sXBxa1Kq0RXEUwimLSz79mger3ysHo4VxKBVQGMg 8GNw== X-Gm-Message-State: AKwxytf6OIFRujZg2oFndlR9crrzJo1IXWxZyneZhSPytunzyAy7GtPP X1OeGXJsYfTxH+WhnFqQDRodDhIjghYskyX2HXa7tA== X-Google-Smtp-Source: AH8x2256oHCKKIgrORKjjwBq0Nwxz5m9fGtz2kjjRVm22GAN1KYMZmHsII/cfdlXYs3EBLumZ+PUxK0y4kvJtm8e9bk= X-Received: by 10.157.81.136 with SMTP id y8mr16525268otg.300.1517041686240; Sat, 27 Jan 2018 00:28:06 -0800 (PST) Original-Received: by 10.74.128.200 with HTTP; Sat, 27 Jan 2018 00:27:45 -0800 (PST) In-Reply-To: <868tcjg4q6.fsf@zoho.com> X-Google-Sender-Auth: DQHiXRQKd_20Ia6pEjB0mgbifco X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c0f::231 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:115866 Archived-At: On Sat, Jan 27, 2018 at 2:06 PM, Emanuel Berg wrote: > Did anyone do > > (defun number-to-string-pad (number len) (format "%04d" number) If you don=E2=80=99t know the length beforehand, you could do: (format (format "%%0%dd" len) number)