Re: Leading Zeros?
- To: mathgroup at smc.vnet.net
- Subject: [mg54362] Re: [mg54319] Leading Zeros?
- From: "Wolf, Hartmut" <Hartmut.Wolf at t-systems.com>
- Date: Sat, 19 Feb 2005 02:32:09 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
>-----Original Message----- >From: AES [mailto:siegman at stanford.edu] To: mathgroup at smc.vnet.net >Sent: Thursday, February 17, 2005 4:31 PM >To: mathgroup at smc.vnet.net >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): In[3]:= y = {1, 2, 3}; Print[PaddedForm[y, 3, NumberPadding -> {"0", "0"}, NumberSigns -> {"-", " "}, SignPadding -> True]]; >From In[3]:= {" 001", " 002", " 003"} -- Hartmut Wolf