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

st: RE: data conversion

From   "Scott Merryman" <>
To   <>
Subject   st: RE: data conversion
Date   Tue, 29 Jun 2004 20:38:29 -0500

You need to specify the format:

gen dob2 = string(dob1, "%10.0g")

or you could use -tostring-

tostring dob1, gen(dob2)

Hope this helps,

-----Original Message-----
[] On Behalf Of M. Nizam Khan
Sent: Tuesday, June 29, 2004 1:20 PM
Subject: st: data conversion

Hi Statalister,

I want to convert dob1,which is a numeric variable, into a string variable.
So I created dob2=string(dob1). But, for example, I want to see "dob2"
as "19410700" not "1.94e+07". How can I do it?

               dob1       dob2

               19410700   1.94e+07


*   For searches and help try:

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