Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: tostring for large double type variables?

From   Nick Cox <>
Subject   Re: st: tostring for large double type variables?
Date   Mon, 8 Aug 2011 17:47:22 +0100

As its original author, I am not clear that this is a good use of
-tostring-, but its -format()- option offers in principle what you

You might get better advice if you said more about the data and quite
how this strange situation occurs. The bottom line is that what you
intend to do with the variable should have most influence on how it is stored.

At the moment I'm having real difficulty imagining a measurement
process that yields 45 digits. Is there a decimal point? Are these
"numbers" just identifiers of some kind?


On Mon, Aug 8, 2011 at 4:11 PM, Paul Burkander <> wrote:
>  I'm appending files over multiple years where the variable type
> changes over time.  I have a variable that's a long string of numbers
> (about 45 numbers) in some years, but which is stored as double in
> other years.  I'd like to be able to store the variable as either a
> string or double in the appended file, but I can't figure out a way to
> use the tostring command that doesn't truncate the double variable.
>  Is there an easy way to preserve the information and string the variable?

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index