MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Formatting integers in strings

  • To: mathgroup at
  • Subject: [mg114375] Formatting integers in strings
  • From: Dan <dflatin at>
  • Date: Thu, 2 Dec 2010 05:41:37 -0500 (EST)

I seem to be having a brain infarction and cannot see past this simple
problem. I would like to be able to format a series of integers so
that they are padded to the left with zeros as in:


Of course, I can write my own function to do this, but I want to use
Mathematica's native formatting functionality.

Here is my first try:


Making the obvious change:


I have looked at the documentation for NumberForm and PaddedForm and
there is no help there for this problem. Every example involves
floating point numbers or integers that are not padded to the left. I
am sure there is some simple concept that I am missing.

  • Prev by Date: Macro processing in Mathematica
  • Next by Date: Re: Reduce::inex problem
  • Previous by thread: Macro processing in Mathematica
  • Next by thread: Re: Formatting integers in strings