Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: Leading Zeros?

  • To: mathgroup at
  • Subject: [mg54362] Re: [mg54319] Leading Zeros?
  • From: "Wolf, Hartmut" <Hartmut.Wolf at>
  • Date: Sat, 19 Feb 2005 02:32:09 -0500 (EST)
  • Sender: owner-wri-mathgroup at


>-----Original Message-----
>From: AES [mailto:siegman at] 
To: mathgroup at
>Sent: Thursday, February 17, 2005 4:31 PM
>To: mathgroup at
>Subject: [mg54362] [mg54319] Leading Zeros?
>A quick test seems to show that if I enter as an input line
>   y = {001,002,003}; Print[y//FullForm];
>the output is List[1,2,3].
>Are the leading zeros gone forever?  Does Mathematica have an 
>official policy on capturing or storing leading zeros?
Dear Professor Siegman,

leading zeros are no properties of numbers, rather of strings, i.e. the
printing form of a number. That may be specified by PaddedForm (see
help), e.g. (adapted from Help):

y = {1, 2, 3};
Print[PaddedForm[y, 3, NumberPadding -> {"0", "0"}, NumberSigns -> {"-",
" "},
       SignPadding -> True]];
>From In[3]:=
{" 001", " 002", " 003"}

Hartmut Wolf

  • Prev by Date: my mathematica no longer renders graphics, even after reinstall
  • Next by Date: how to find packages when using NETLINK
  • Previous by thread: Re: Leading Zeros?
  • Next by thread: Re: grphing in Mathematica