Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: Leading Zero's


From   "SJ Friederich, Economics" <S.Friederich@bristol.ac.uk>
To   statalist@hsphsun2.harvard.edu, Alexander Quarshie <Alexander_Quarshie@msm.edu>
Subject   Re: st: RE: Leading Zero's
Date   Tue, 01 Jul 2003 19:12:10 +0100

Alexander_Quarshie@msm.edu wrote:

Dear all,
Does anyone know a quick way in STATA to add leading zeros to a numeric
variable (even if I have to convert it to a string, that would be okay).
A typical example might be to convert the following numbers to a standard
five-digit number with leading zeros: 2 -->  00002
33 --> 00033
473 --> 00473
59724 --> 59724

This comes up fairly regularly. See:

findit leading zeros

Sylvain
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index