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

st: RE: destring, keeping leading zeros


From   "David Harrison" <[email protected]>
To   <[email protected]>
Subject   st: RE: destring, keeping leading zeros
Date   Tue, 5 Jul 2005 15:35:39 +0100

123 and 0123 are the same number. You can never make the variable numeric and "keep them distinct" - if the distinction is important, then they are not numbers, they are codes and the string format is the correct one.

David

-----Original Message-----
From: Nawar, Eric [mailto:[email protected]]
Sent: 05 July 2005 15:00
To: [email protected]
Subject: st: destring, keeping leading zeros


I have a string variable which has the following distinct codes:

0123
123

I want to make the variable numeric, but I want to keep the leading zero
on the first code to keep them distinct.  A suggestion to a similar
posting was to format with leading zeros - but this would make both
codes "0123".

Thanks,
Eric

*
*   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/



*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index